Untitled

mail@pastecode.io avatar
unknown
csharp
21 days ago
940 B
4
Indexable
Never
bool isSent = false;
            string subjectName = "MARIA THERESA CORTES";
            var client = new SendGridClient("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");
            var from = new EmailAddress("biis@immigration.gov.ph", "donotreply@immigration.gov.ph");
            var to = new EmailAddress("subject email", "subject name");
            var templateId = "d-778a6b6a893347a1be4685b1a8d273ee";
            var dynamicTemplateData = new
            {
                SUBJECT_NAME = subjectName,
                REFERENCE_NO = "BI24136B6889229",
                STATUS = "COMPLETED",
                DOCKET_NO = "COR-2022-077"
            };
            var msg = MailHelper.CreateSingleTemplateEmail(from, to, templateId, dynamicTemplateData);
            var response = await client.SendEmailAsync(msg);

            if (response.IsSuccessStatusCode)
                isSent = true;
Leave a Comment