AddAsync() public method

public AddAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
コード例 #1
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);
            }
        }
コード例 #2
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);                
            }
        }
コード例 #3
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");
            }
        }
コード例 #4
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);
            }
        }