https://www.vivienfabing.com/dotnetcore/2019/04/14/how-to-send-a-dynamic-email-from-sendgrid-with-dotnet-core.html

                var sendGridClient = new SendGridClient(Environment.GetEnvironmentVariable("SendGridKey"));
                var sendGridMessage = new SendGridMessage();

                sendGridMessage.SetFrom("test@test.com", "John Doe");
                sendGridMessage.AddTo("test2@test.com", "Jane Doe");
                sendGridMessage.SetTemplateId("d-15481283818ccffee13cf88sdf3439f9");
                sendGridMessage.SetTemplateData(JsonObject);

                var response = sendGridClient.SendEmailAsync(sendGridMessage).Result;
Last modified: November 6, 2023

Author

Comments

Write a Reply or Comment