예제 #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());
 }
예제 #2
0
        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
파일: ResetEmail.cs 프로젝트: frapid/frapid
        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");
            }
        }