public ActionResult EditSubscriptionEmailTemplate(SubscriptionEmailTemplateRecord rec)
        {
            if (TryUpdateModel(rec))
            {
                _subscriptionNotificationTranslationService.Update( rec.Title, rec.BodyPlainText, rec.BodyHtml);
                _orchardServices.Notifier.Add(NotifyType.Information, T("The email template was successfully updated."));                
            };

            return View(rec);
        }
Beispiel #2
0
        public int UpdateFrom12()
        {
            var defaultSubscriptionEmailTemplate = new SubscriptionEmailTemplateRecord();
            defaultSubscriptionEmailTemplate.Title = "A new post was made to a forum topic you subscribed to at [SiteName]";
            defaultSubscriptionEmailTemplate.BodyPlainText = "You are receiving this email because you subscribed to receive post notifications on the thread:" + Environment.NewLine +
                                                             "'[ThreadTitle]' " + Environment.NewLine + Environment.NewLine +

                                                             "The contents of the new post are as follows:" + Environment.NewLine + Environment.NewLine +

                                                             "[PostText]" + Environment.NewLine + Environment.NewLine +

                                                             "To view this post or respond go to [PostUrl]" + Environment.NewLine;

            defaultSubscriptionEmailTemplate.BodyHtml = "<html><body>" + 
                                                        "<p>{\"You received this email because you subscribed to receive post notification on the thread:\"}</p>" +
                                                        "<p><i>[ThreadTitle]</i></p>" +
                                                        "<p>{(\"The contents of the new post is as follows:\"} </p>" +
                                                        "<p>[PostText]</p>" +
                                                        "<p>{(\"To view this post or to respond go to\"} [PostUrl]</p>" +
                                                        "</body></html>";

            _subscriptionEmailTemplateRepository.Create(defaultSubscriptionEmailTemplate);

            return 13;
        }