Exemplo n.º 1
0
        public async Task HandleAsync(AccountApprovedEvent message)
        {
            using (LogContext.PushProperty("IntegrationEventContext", $"{message}"))
            {
                _logger.LogInformation($"Account has been approved: {message}");

                _logger.LogInformation("-----Publishing AccountApprovedEvent integration event----- ");

                await _bus.SendReceive.SendAsync(queueName, new EmailData
                {
                    RecipientMail = message.RecepientMail,
                    EmailBody     = _messageTemplate.GetAccountApprovedTemplate(message)
                });
            }
        }
Exemplo n.º 2
0
        public string GetAccountApprovedTemplate(AccountApprovedEvent message)
        {
            string header    = "WHAT Project";
            string emailBody =
                "<table style='width: 100% !important;border-collapse: collapse; width: 100% !important;height: 100%;background: #efefef;-webkit-font-smoothing: antialiased;-webkit-text-size-adjust: none;'>" +
                "<tr>" +
                "<td style='display: block !important;clear: both !important;margin: 0 auto !important;max-width: 580px !important;'>" +
                "<table style='width: 100% !important;border-collapse: collapse;'>" +
                "<tr>" +
                "<td style='padding: 45px 0; position:relative; background-repeat: no-repeat; background-size: cover;background-image: url(https://cdnssinc-dev.azureedge.net/img/home/gradient-map-1.jpg);' align='center'>" +
                "<h1 style='font-size: 32px; margin-bottom: 20px;line-height: 1.25;'>" + header + "</h1>" +
                "</td>" +
                "</tr>" +
                "<tr>" +
                "<td style='display: block !important;clear: both !important;margin: 0 auto !important;max-width: 580px !important;'>" +
                "<p>" +
                "Welcome, " + message.FirstName + " " + message.LastName + "! " + "Your account has been successfully approved!" +
                "</p>" +
                "<p>" +
                "<ul>" +
                "<li>" +
                "Your role: " + message.Role +
                "</li>" +
                "</ul>" +
                "</p>" +
                "</td>" +
                "</tr>" +
                "</table>" +
                "</td>" +
                "</tr>" +
                "<tr>" +
                "<td class='container'>" +
                "<table style='width: 100% !important;border-collapse: collapse;'>" +
                "<tr>" +
                "<td class='content footer' align='center'>" +
                "<p>© Copyright 2020 SoftServe</p>" +
                "</td>" +
                "</tr>" +
                "</table>" +
                "</td>" +
                "</tr>" +
                "</table>";

            return(emailBody);
        }
 public void Handle(AccountApprovedEvent <T> evt)
 {
     Process(evt);
 }