private void SendMemberEmail(SiteSettings siteSettings, MemberModel model, string subject, string body, bool overrideOptIn, string from)
        {
            if (!overrideOptIn && !model.EmailOptIn)
            {
                return;
            }

            body = ReplaceMemberProperties(body, model);
            _emailService.SendEmail(siteSettings.SiteUrl, model.Chapter, subject, body, new string[] { model.Email }, from);
        }
예제 #2
0
        public ActionResult SendTestEmail(string to, EmailViewModel email, bool fromUser)
        {
            if (CurrentMemberModel.AdminUserId == null)
            {
                return(RedirectToHome());
            }

            ServiceResult result = _emailService.SendEmail(SiteSettings.SiteUrl, HomePage, email.Subject, email.Body, new[] { to },
                                                           fromUser ? CurrentMemberModel.Email : null);

            AddFeedback(result.ErrorMessage, result.Success);

            return(RedirectToCurrentUmbracoPage());
        }