f0zzyNUE
  • Posts: 89
  • Joined: 09/09/2010
hi,

what about extending the email notification functionality with the
* possibility to include the text body of the private message in the pn notification email
* possibility to include the text body of a new post in the "new post" notification email

is it also possible to send HTML mails which could be nicely formatted?

thanks in advance
CHris
Sponsor
Jaben
  • Posts: 2544
  • Joined: 09/10/2004
Both suggestions already exist in v1.9.5.:

Html is an option... just create an HTML template for the notification emails.
f0zzyNUE
  • Posts: 89
  • Joined: 09/09/2010
Jaben wrote:

Both suggestions already exist in v1.9.5.:

Html is an option... just create an HTML template for the notification emails.



is there any documentation which placeholders i should use in the email templates? the default ones don't include the body text.

thanks
CHris
f0zzyNUE
  • Posts: 89
  • Joined: 09/09/2010
hmmm, i looked up yafsendnotification.cs

for pm notifications only four template replacements are implemented. i miss the text body placeholder (maybe also the bodytruncated one)

notificationTemplate.TemplateParams["{fromuser}"] = YafContext.Current.PageUserName;
notificationTemplate.TemplateParams["{link}"] =
            "{0}\r\n\r\n".FormatWith(
              YafBuildLink.GetLinkNotEscaped(ForumPages.cp_message, true, "pm={0}", userPMessageId));
notificationTemplate.TemplateParams["{forumname}"] = YafContext.Current.BoardSettings.Name;
notificationTemplate.TemplateParams["{subject}"] = subject;


for watching users (notifications on new posts) it seems to be implemented
watchEmail.TemplateParams["{forumname}"] = YafContext.Current.BoardSettings.Name;
watchEmail.TemplateParams["{topic}"] = HttpUtility.HtmlDecode(message.Topic);
watchEmail.TemplateParams["{postedby}"] = UserMembershipHelper.GetDisplayNameFromID(userId);
watchEmail.TemplateParams["{body}"] = bodyText;
watchEmail.TemplateParams["{bodytruncated}"] = StringHelper.Truncate(bodyText, 160);
watchEmail.TemplateParams["{link}"] = YafBuildLink.GetLinkNotEscaped(ForumPages.posts, true, "m={0}#post{0}", newMessageId);
f0zzyNUE
  • Posts: 89
  • Joined: 09/09/2010
i am currently testing the possibilities of modifying the email notification:

two more improvement suggestions:
* handle quotes in a special way (currently the quote-brackets are removed and it seems that all text including the quoted message is posted by the user)
* handle links, images, bold formatting in a special way (e.g. links and images in brackets after the linked text passage, * around bold text)

something like

f0zzyNUE wrote:

this is the quoted text


here you can find the answer 


could end up in


"f0zzyNUE: this is the quoted text"
here *you* can find the answer (http://www.google.de)
-----------------
Jaben
  • Posts: 2544
  • Joined: 09/10/2004
Woah, thanks for this work. You are correct, it doesn't support the HTML at this time looking at that code. I thought I put that in there. 🙂
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved