Exemple #1
0
        public EmailHelper ApplyTemplate(string mailType, TemplatePipeline pipeline)
        {
            var messageToPersonalize = new TemplateMailMessage(_mailConfiguration, mailType);

            if (messageToPersonalize.Loaded)
            {
                var engine = new TemplateEngine(messageToPersonalize, pipeline);
                CurrentEngine = engine;
            }
            return(this);
        }
 public TemplateEngine(IFormatableTextProvider provider, TemplatePipeline pipeline)
 {
     TextProvider = provider;
     Pipeline = pipeline;
 }
        public EmailHelper ApplyTemplate(string mailType, TemplatePipeline pipeline, Action emailSentAction = null, Action emailFailedAction = null)
        {
            var mailConfig = XmlSection<MailConfiguration>.GetSection("mailConfiguration");
            if (mailConfig.CommonConfiguration.OverrideToAddress)
            {
                ToAddressOverride = mailConfig.CommonConfiguration.ToAddress;
            }

            var messageToPersonalize = new TemplateMailMessage(mailType);
            if (messageToPersonalize.Loaded)
            {
                var engine = new TemplateEngine(messageToPersonalize, pipeline);
                CurrentEngine = engine;
                return this;
            }
            return null;
        }
 public TemplateEngine(TemplateMailMessage provider, TemplatePipeline pipeline)
 {
     TextProvider = provider;
     Pipeline     = pipeline;
 }