public async Task Send(IEnumerable <CertificateResponse> certificateResponses) { var emailTemplate = await _assessorServiceApi.GetEmailTemplate(EMailTemplateNames.PrivatelyFundedCertificatesApprovals); var personalisation = CreatePersonalisationTokens(certificateResponses); _aggregateLogger.LogInfo("Send Email"); var recipients = emailTemplate.Recipients.Split(';').Select(x => x.Trim()); foreach (var recipient in recipients) { var email = new Email { RecipientsAddress = recipient, TemplateId = emailTemplate.TemplateId, ReplyToAddress = "*****@*****.**", Subject = "Test Subject", SystemId = "PrivatelyFundedCertificatesApprovals", Tokens = personalisation }; await _notificationsApi.SendEmail(email); } }
public async Task Send(int batchNumber, List <CertificateResponse> certificateResponses, string certificatesFileName) { var emailTemplate = await _assessorServiceApi.GetEmailTemplate(EMailTemplateNames.PrintAssessorCoverLetters); var personalisation = CreatePersonalisationTokens(certificateResponses, certificatesFileName); _aggregateLogger.LogInfo("Send Email"); var recipients = emailTemplate.Recipients.Split(';').Select(x => x.Trim()); foreach (var recipient in recipients) { var email = new Email { RecipientsAddress = recipient, TemplateId = emailTemplate.TemplateId, ReplyToAddress = "*****@*****.**", Subject = "Test Subject", SystemId = "PrintAssessorCoverLetters", Tokens = personalisation }; await _notificationsApi.SendEmail(email); } }