f0zzyNUE
  •  f0zzyNUE
  • 100% (Exalted)
  • YAF Commander Topic Starter
2010-10-06T09:13:21Z
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
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2010-10-06T16:27:22Z
Both suggestions already exist in v1.9.5.:

Html is an option... just create an HTML template for the notification emails.
f0zzyNUE
  •  f0zzyNUE
  • 100% (Exalted)
  • YAF Commander Topic Starter
2010-10-06T18:04:48Z
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
  •  f0zzyNUE
  • 100% (Exalted)
  • YAF Commander Topic Starter
2010-10-10T10:02:18Z
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
  •  f0zzyNUE
  • 100% (Exalted)
  • YAF Commander Topic Starter
2010-10-10T10:52:40Z
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
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2010-10-10T16:29:21Z
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. 🙂

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