using Mvc.Mailer;

namespace Qusion.WebApp.Areas.Qusion.Mailers.Account
{
    public class AccountMailer : MailerBase
    {
        #region Implementation of IAccountMailer

        public MvcMailMessage PasswordReset(PasswordResetMailerModel model)
        {
            return Populate(x =>
                                {
                                    x.Subject = model.Subject;
                                    x.ViewName = model.ViewName;
                                    x.To.Add(model.Email);
                                    ViewData.Model = model;
                                });
        }

        public MvcMailMessage CreateUser(CreateNewAccount model)
        {
            return Populate(x =>
                                {
                                    x.Subject = model.Subject;
                                    x.ViewName = model.ViewName;
                                    x.To.Add(model.Email);
                                    ViewData.Model = model;
                                });
        }

        public MvcMailMessage ChangePassword(ChangePasswordMailerModel model)
        {
            return Populate(x =>
                                {
                                    x.Subject = model.Subject;
                                    x.ViewName = model.ViewName;
                                    x.To.Add(model.Email);
                                    ViewData.Model = model;
                                });
        }

        #endregion
    }
}