public Task <Response> SendAdfEmail(List <EmailAddress> emailTo, IEmailTemplate emailTemplate) { SendGridMessage sendGridMessage = new SendGridMessage(); sendGridMessage.SetFrom(EmailFrom); sendGridMessage.SetGlobalSubject(AdfEmailSubject); if (!string.IsNullOrEmpty(emailTemplate.AsPlainText())) { sendGridMessage.AddContent("text/plain", emailTemplate.AsPlainText()); } for (int personalizationIndex = 0; personalizationIndex < emailTo.Count; ++personalizationIndex) { sendGridMessage.AddTo(emailTo[personalizationIndex], personalizationIndex); } return(SendGridClient.SendEmailAsync(sendGridMessage)); }
public Task <Response> SendCompleteBookingEmail(EmailAddress emailTo, IEmailTemplate emailTemplate) { SendGridMessage message = MailHelper.CreateSingleEmail(EmailFrom, emailTo, CompleteBookingSubject, emailTemplate.AsPlainText(), emailTemplate.AsHtml()); return(SendGridClient.SendEmailAsync(message)); }
public Task <Response> SendExpertNotificationEmail(List <EmailAddress> emailTo, IEmailTemplate emailTemplate) { SendGridMessage message = MailHelper.CreateSingleEmailToMultipleRecipients(EmailFrom, emailTo, NewLeadNotificationSubject, emailTemplate.AsPlainText(), emailTemplate.AsHtml()); return(SendGridClient.SendEmailAsync(message)); }
public Task <Response> SendDealerInvitationEmail(EmailAddress emailTo, IEmailTemplate emailTemplate) { SendGridMessage message = MailHelper.CreateSingleEmail(EmailFrom, emailTo, DealerInvitationSubject, emailTemplate.AsPlainText(), emailTemplate.AsHtml()); return(SendGridClient.SendEmailAsync(message)); }