Esempio n. 1
0
        private static async Task SendMaskRequestDeniedEmail(EmailSettings emailSettings, MaskRequestModel maskRequestModel, string message = "")
        {
            var htmlMessageSB = new StringBuilder(await EmailUtils.GetEmailHTMLTemplate(EmailMessageType.MaskRequestDenied));

            htmlMessageSB.Replace("{Message}", !string.IsNullOrEmpty(message) ? message : @"We’re sorry, we’re not able to list your request.<br />Your request does not meet the requirements.<br />Please, for more details visit https://midwesthelps.com/resources. <br />Thank you!");
            await EmailUtils.SendEmailAsync(emailSettings, htmlMessageSB.ToString(), "We’re sorry, we’re not able to list your request", "Mask request denied", maskRequestModel.Recipient.Email);
        }
Esempio n. 2
0
        private static async Task SendDonationOnItsWayEmail(EmailSettings emailSettings, MaskDonationModel maskDonationModel)
        {
            var recipient = maskDonationModel.Request.Recipient;
            var donor     = maskDonationModel.Donor;

            var updateStatusLink = "midwesthelps.com/donationStatus";
            var donorCompany     = !string.IsNullOrEmpty(donor.Company) ? $"<br />{donor.Company}" : "";

            var htmlMessageSB = new StringBuilder(await EmailUtils.GetEmailHTMLTemplate(EmailMessageType.DonationOnItsWay));

            htmlMessageSB.Replace("{DonorName}", donor.Name)
            .Replace("{DonorEmail}", donor.Email)
            .Replace("{DonorPhone}", donor.Phone)
            .Replace("{DonorCompany}", donorCompany)
            .Replace("{MaskDetails}", getMaskDetailsForEmail(maskDonationModel.Donation))
            .Replace("{Status}", EnumUtils.GetName(DonationStatus.Received))
            .Replace("{Id}", maskDonationModel.Id.ToString())
            .Replace("{ReceivedDonationLink}", updateStatusLink);
            await EmailUtils.SendEmailAsync(emailSettings, htmlMessageSB.ToString(), $"{maskDonationModel.Donor.Name} has a donation!", "You got a donation offer", recipient.Email);
        }