ProcessMailQueueAsync() public method

public ProcessMailQueueAsync ( IEmailProcessor processor ) : System.Threading.Tasks.Task
processor IEmailProcessor
return System.Threading.Tasks.Task
コード例 #1
0
ファイル: WelcomeEmail.cs プロジェクト: nubiancc/frapid
 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
ファイル: 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);
            }
        }
コード例 #4
0
ファイル: WelcomeEmail.cs プロジェクト: manishkungwani/frapid
        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);
        }
コード例 #5
0
        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");
            }
        }
コード例 #6
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");
            }
        }
コード例 #7
0
ファイル: SignUpEmail.cs プロジェクト: frapid/frapid
        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);
            }
        }
コード例 #8
0
ファイル: ContactUsEmail.cs プロジェクト: frapid/frapid
        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);                
            }
        }