Esempio n. 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);
        }
Esempio n. 2
0
        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;
 }