using System; using System.IO; using Microsoft.Azure.Functions.Worker; using Microsoft.Extensions.Logging; using SendGrid.Helpers.Mail; using Microsoft.Azure.WebJobs; namespace BlackRockReportFunction { public class MailSenderFunction { private readonly ILogger _logger; public MailSenderFunction(ILoggerFactory loggerFactory) { _logger = loggerFactory.CreateLogger(); } //http://127.0.0.1:10000/devstoreaccount1/report-container [Function("MailSenderFunction")] public SendGridMessage Run([BlobTrigger("report-container/{name}", Connection = "AzureWebJobsStorage")] string fileData, string fileName) { _logger.LogInformation($"C# Blob trigger function Processed blob\n New file detected with name: {fileName}"); return null; //var msg = new SendGridMessage() //{ // From = new EmailAddress("nikola.jovanovic@dilig.net", "Nikola Jovanovic"), // Subject = "Test SendGrid Azure Function", // PlainTextContent = String.Format("If you read this text, then congratulations," + // " you did it! :)") //}; //msg.AddTo(new EmailAddress("nikolajovanovic3579@gmail.com", "Nikola Jovanovic")); //return msg; } } }