Adding fields to NewMessagePostedToThread emails

rated by 0 users
This post has 1 Reply | 1 Follower

Not Ranked
Posts 17
Points 205
Orion Culver Posted: Thu, Jul 10 2008 10:54 AM

CS Version from file CS2007_3.0.20611.960.sdk.zip (I don't know how else to identify the version of my install of CS).

I need to add more fields in the email that is sent when a new post is sent out to subscribers.  I need to add the name of the parent forum, as well as the text in a custom drop down list I added to posts by way of a subform.

Could someone explain how to do this?

- O8

 

Not Ranked
Posts 17
Points 205

I've looked through the source to figure this out, & it all seems to come down to Emails.CreatePost( Post post, string emailType, User userTo ) in Emails.cs, in CommunityServer.MailGateway.MailRoom.

This method gets the template based upon emailType parameter, then gets the tokens via the EmailTemplateProvider.GetCommonFields() & EmailTemplateProvider.GetPostFields( Post post, bool isHtml ).  The EmailTemplate & the generic list of EmailTextTokens are then passed to Emails.QueueMessage( EmailTemplate message, List<EmailTextToken> tokens ), in which the template processes the tokens, assumedly replacing the special tags in the template with the tokens' values (not certain on this as this is done within the closed EmailTemplate class).

If this is correct, it seems I would need to modify two things:  the NewMessagePostedToThread email template xml (in the emails.xml file in /Languages/en-US/emails folder), as well as provide an additional method that gathers the additional tokens from the ForumPost (namely, the country name associated with post, which is provided via a drop down list, and the name of the parent forum to the forum in which the forum post was posted).

I have 1 additional constraint, following the suggestions in Professional Community Server published by Wrox:  try to avoid changing the CommunityServer source as much as possible.  So far, the changes I have made have been to resource files, config files, & my own separate solution, which has worked wonderfully.  Unfortunately, this portion of modification seems to require changing the source.  Even if I create my own EmailTemplateProvider, it appears I have to force the source to call a method in it to get the new tokens.

Can someone tell me if there is a way to avoid changing the source to accomplish what I am tasked with?

- O8

 

Page 1 of 1 (2 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com