Email Template Subject

Email Template Subject

This question has suggested answer(s)

Telligent Community 6.1.

 We want to add some static text to the subject line of emails sent via the mail gateway - for example,the subject currently looks like this:

[Known Issues] Custom Development Question

We want it to be:

Forums Discussion - [Known Issues] Custom Development Question

(with the "Forums Discussion - " being prepended for every email regardless of group.)

So, looking at the forum_post_mailgateway.xml template, I see

<subject> 
   <![CDATA[
#if($core_v2_forumThread.Current)
   #set($post = $core_v2_forumThread.Current)
#else
   #set($post = $core_v2_forumReply.Current)
#end
$email_utility.FormatSubjectWithMailingList($post)
			]]>
		</subject>

I thought I could set it to a variable and have it right before $email_utility.FormatSubjectWithMailingList($post)

#set($prepend = "Forums Discussion - ")
$prepend$email_utility.FormatSubjectWithMailingList($post) ]]> </subject>

But the issue is that the subject line keeps growing as people reply:

Forums Discussion - RE: [ Best Practices] Time entry

Forums Discussion - RE: [Best Practices] Forums Discussion - Re: Forums Discussion - RE: [Best Practices] Time entry

and so forth until the subject has gotten unmanageable.

So, something I'm doing is really wrong. What is the best way to do this, and have it not keep messing up the subject line, when people keep replying?

All Replies
  • Unfortunately that way will continue to chain the subjects :(  Instead, you can always use the thread's subject rather than the reply's subject.

    <subject>
    	<![CDATA[
    #if($core_v2_forumThread.Current)
    	#set($post = $core_v2_forumThread.Current)
    #else
    	#set($post = $core_v2_forumThread.Get($core_v2_forumReply.Current.ThreadId))
    #end
    Forum Discussion - $email_utility.FormatSubjectWithMailingList($post)
    	]]>
    </subject>

    This will always use the original subject of the thread instead of the chain of RE:'s which should alleviate the problem in a different way.