示例#1
0
 private string PrepareEmailBody(EmailTemplateModel model)
 {
     var emailTemplate = new EmailTemplate(model);
     return emailTemplate.TransformText();
 }
示例#2
0
        protected virtual MailMessage PrepareEmail(LoggingEvent loggingEvent)
        {
            var model = new EmailTemplateModel(loggingEvent)
            {
                Title = Title,
                TitleUri = TitleUri,
                IpAddressInfoUri = IpAddressInfoUri,
                UserAgentInfoUri = UserAgentInfoUri
            };

            var mailMessage = new MailMessage(From, To);

            mailMessage.Subject = model.GetFormattedSubject();
            mailMessage.IsBodyHtml = true;
            mailMessage.Body = PrepareEmailBody(model);

            return mailMessage;
        }