Я отправляю письмо с подтверждением, используя SendGrid для подтверждения, но
ApiKey всегда null
public Task SendAsync(IdentityMessage message)
{
var ApiKey = Environment.GetEnvironmentVariable("ApiKeyFromSendGrid");
var client = new SendGridClient(ApiKey);
var from = new EmailAddress("XXX@gmail.com", "Any Name");
var subject = "Sending with SendGrid is Fun";
var to = new EmailAddress(message.Destination, "Any Name");
var plainTextContent = "and easy to do anywhere, even with C#";
var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>";
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
var response = client.SendEmailAsync(msg);
return response;
}
где ошибка?
введите описание изображения здесь