Mailing List 'From' field

Mailing List 'From' field

This question has suggested answer(s)

Under Dashboard/Administration/Forum Admin/Editing Forum: <Internal Forum Name>, we have the Mailing List enabled and when emails come in, the 'To' field is set to: "mailing_list@e2e.ti.com". However the 'From' field is set to: 'TI E2E Community -Automated Emails [noreply@e2e.ti.com]". What we are trying to do is have the 'From' field set to "Patrick Ftizpatrick [noreply@e2e.ti.com]", or whoever the user posting is.

But, we are still wanting for normal notifications (external posts), the 'From' field should be set to 'TI E2E Community -Automated Emails [noreply@e2e.ti.com]"

I would like to mention that in our templates, we are using $email_header.SetHeader. For example, in forum_post.xml, we have,

		<subject>
			<![CDATA[
$email_header.SetHeader("From", "TI E2E Community - Automated Email <$core_v2_configuration.FromSiteEmailAddress>")

#if($core_v2_forumThread.Current)
	#set($post = $core_v2_forumThread.Current)
#else
	#set($post = $core_v2_forumReply.Current)
#end
#set($forum = $core_v2_forum.Get($post.ForumId))
#set($subject = "$core_v2_forum.Get($post.ForumId).Name: $post.Subject")
$subject
			]]>
		</subject>

Can you advise how to have the email template configured for both scenarios. Thanks

Patrick

All Replies
  • Hi Patrick,

    So for certain forums (internal) you want the From to say the actual user's name but for other forums (external) you want it to show what it does now?  You can do this by editing the email template to perform some logic based on the forum and set the From appropriately.  Something like this.

    #if($forum.Id == 1 || $forum.Id == 2 || ...) ## These would be the ForumIds of your internal forums
      $email_header.SetHeader("From", $email_utility.FormatNameAndEmail($post.User.DisplayName, "noreply@e2e.ti.com"))
    #else
      $email_header.SetHeader("From", $email_utility.FormatFromSite("TI E2E Community - Automated Email"))
    #end
  • Hi Blake,

    thanks for the reply. That solution would be difficult to maintain with new forums and having to update the templates with the new id's each time.

    But, that being said - since we always preface our internal forums with 'INT-', I guess we can do a substring match on the forum name itself and display accordingly.

    Patrick

  • You could create a custom email extension to hold more complicate logic for (e.g. pulling a list of internal forum IDs from a database table).

    #if($my_extension.IsInternal($forum.Id))

     Internal

    #else

     External

    #end

    See telligent.com/.../20862.extending-email-via-iemailtemplateextension.aspx for more details.

  • For Patrick's query, his varyby is actually just forums with email gateway enabled vs those without...  Dont we already use seperate email templates for these?  Or is there existing properties he can use to check?

    Dan

  • Forums with a mailing list enabled use the forum_post_mailgateway.xml template while forums without an email enabled use the forum_post.xml template.  If what Dan said is the case, you can just set the header in the forum_post_mailgateway.xml template and not have to do any special logic.

  • Hi Blake,

    just getting back to testing this.

    So, we are seeing both emails come through, but before in 5.5, for those INT forums that had a mailing list associated with, the email would come in like:

    From: FOE <foe@noreply.e2e.ti.com> // FOE is the poster's username
    cc: int_lprf_list@e2e.ti.com

    When the recipient would hit 'reply', the return email would have "int_lprf_list@e2e.ti.com" in the 'To' field and not 'foe@noreply.e2e.ti.com'

    As of now, the email we get is:

    From: TI E2E Community - Automated Email [mailto:noreply@e2e.ti.com]
    To: int_lprf_list@e2e.ti.com

    Hope that makes sense.

    Patrick

  • In 6.x (and maybe 5.6, I can't remember) the forum emails are sent out in batches, with users in the BCC to improve performance.  That's why you see your mailing list in the To and no other recipients.  However, if you reply to the forum email it should automatically put the mailing list in the To for the reply (int_lprf_list@e2e.ti.com in your case).  

    This is done by setting the "Reply-To" header in the email.  Telligent Evolution automatically does this but you can also overwrite what it puts there using the  $email_header.SetHeader("Reply-To", "default@reply.email") extension.