private static PasswordlessLoginBuilder AddEmailTemplates(this PasswordlessLoginBuilder builder, IFileProvider templateFileProvider, CultureInfo[] supportedCultures = null, bool force = false)
        {
            var emailTemplates = EmailTemplateProcessor.GetTemplates(templateFileProvider, supportedCultures);

            if (force)
            {
                builder.Services.AddSingleton(emailTemplates);
            }
            else
            {
                builder.Services.TryAddSingleton(emailTemplates);
            }

            return(builder);
        }
Exemple #2
0
        private static string ProcessEmailMessage(long tranId)
        {
            string template = EmailTemplateHelper.GetTemplateFileContents("/Static/Templates/Email/Sales/Delivery.html");

            List <object> dictionary = new List <object>
            {
                AppUsers.GetCurrent().View,
                          Data.Transactions.Delivery.GetSalesDeliveryView(AppUsers.GetCurrentUserDB(), tranId)
            };

            var processor = new EmailTemplateProcessor(template, dictionary);

            template = processor.Process();

            return(template);
        }
        private static string ProcessEmailMessage(long tranId, string token)
        {
            string template = EmailTemplateHelper.GetTemplateFileContents("/Static/Templates/Email/Sales/Quotation.html");
            string link     = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) +
                              "/Public/ApproveQuotation.aspx?ValidationId=" + token;


            template = template.Replace("{QuotationAcceptLink}", link);

            List <object> dictionary = new List <object>
            {
                AppUsers.GetCurrent().View,
                          Data.Transactions.Quotation.GetSalesQuotationView(AppUsers.GetCurrentUserDB(), tranId)
            };

            EmailTemplateProcessor processor = new EmailTemplateProcessor(template, dictionary);

            template = processor.Process();

            return(template);
        }