示例#1
0
 public async Task SendAsync()
 {
     string template = GetTemplate();
     string parsed = ParseTemplate(template);
     string subject = "Welcome to " + HttpContext.Current.Request.Url.Authority;
     string catalog = AppUsers.GetCatalog();
     var email = this.GetEmail(this._user, subject, parsed);
     var queue = new MailQueueManager(catalog, email);
     queue.Add();
     await queue.ProcessMailQueueAsync(EmailProcessor.GetDefault());
 }
        public async Task SendAsync(string catalog, Subscribe model)
        {
            try
            {
                var email = this.GetEmail(catalog, model);
                var manager = new MailQueueManager(catalog, email);
                manager.Add();

                await manager.ProcessMailQueueAsync(EmailProcessor.GetDefault());
            }
            catch
            {
                throw new HttpException(500, "Internal Server Error");
            }
        }
示例#3
0
        public async Task SendAsync(string tenant)
        {
            string template = this.GetTemplate(tenant);
            string parsed = this.ParseTemplate(this._context, template);
            string subject = "Confirm Your Registration at " + this._context.Request.Url.Authority;

            var processor = EmailProcessor.GetDefault(tenant);

            if (processor != null)
            {
                var email = this.GetEmail(processor, this._registration, subject, parsed);

                var queue = new MailQueueManager(tenant, email);

                await queue.AddAsync().ConfigureAwait(false);
                await queue.ProcessMailQueueAsync(processor).ConfigureAwait(false);
            }
        }
示例#4
0
        public async Task SendAsync(string tenant)
        {
            string template = this.GetTemplate(tenant);
            string parsed = this.ParseTemplate(template);
            string subject = "Your Password Reset Link for " + HttpContext.Current.Request.Url.Authority;

            var processor = EmailProcessor.GetDefault(tenant);

            if (processor != null)
            {
                var email = this.GetEmail(processor, this._resetDetails, subject, parsed);

                var queue = new MailQueueManager(tenant, email);
                await queue.AddAsync().ConfigureAwait(false);

                await queue.ProcessMailQueueAsync(processor).ConfigureAwait(false);
            }
        }
示例#5
0
        public async Task SendAsync(string tenant, ContactForm model)
        {
            var email = await this.GetEmailAsync(tenant, model).ConfigureAwait(false);
            var manager = new MailQueueManager(tenant, email);
            await manager.AddAsync().ConfigureAwait(false);

            var processor = EmailProcessor.GetDefault(tenant);

            if(processor != null)
            {
                if (string.IsNullOrWhiteSpace(email.ReplyTo))
                {
                    email.ReplyTo = processor.Config.FromEmail;
                }

                await manager.ProcessMailQueueAsync(processor).ConfigureAwait(false);                
            }
        }
示例#6
0
        public async Task SendAsync()
        {
            string template = this.GetTemplate();
            string parsed = this.ParseTemplate(template);
            string subject = "Welcome to " + HttpContext.Current.Request.Url.Authority;
            string catalog = AppUsers.GetCatalog();
            var email = this.GetEmail(this._user, subject, parsed);

            var processor = EmailProcessor.GetDefault(catalog);

            if (string.IsNullOrWhiteSpace(email.ReplyTo))
            {
                email.ReplyTo = processor.Config.FromEmail;
            }

            var queue = new MailQueueManager(catalog, email);
            queue.Add();
            await queue.ProcessMailQueueAsync(processor);
        }
        public async Task SendAsync(string catalog, Subscribe model)
        {
            try
            {
                var email = this.GetEmail(catalog, model);
                var manager = new MailQueueManager(catalog, email);
                manager.Add();

                var processor = EmailProcessor.GetDefault(catalog);

                if (string.IsNullOrWhiteSpace(email.ReplyTo))
                {
                    email.ReplyTo = processor.Config.FromEmail;
                }

                await manager.ProcessMailQueueAsync(processor);
            }
            catch
            {
                throw new HttpException(500, "Internal Server Error");
            }
        }
示例#8
0
        public async Task SendAsync(string tenant, Subscribe model)
        {
            try
            {
                var email = this.GetEmail(tenant, model);
                var manager = new MailQueueManager(tenant, email);
                await manager.AddAsync().ConfigureAwait(false);

                var processor = EmailProcessor.GetDefault(tenant);
                if(processor != null)
                {
                    if (string.IsNullOrWhiteSpace(email.ReplyTo))
                    {
                        email.ReplyTo = processor.Config.FromEmail;
                    }

                    await manager.ProcessMailQueueAsync(processor).ConfigureAwait(false);                    
                }
            }
            catch
            {
                throw new HttpException(500, "Internal Server Error");
            }
        }