Email Thread Notification


Thread Notification Email

The thread notification email is sent to notify users who previously commented on a file that the file has received a new comment.
This email contains the comment, and a link to the medianotificationoptout page that allows the user to opt-out of notification emails.
View how to create the Thread Notification Email template.

NB 1: The URL of the link to the opt-out notification page provided in this email will be for to the application that the email template is in.

NB 2: You have to create the threadnotificationoptout page in order for the users to be able to opt out of thread notifications.

The owner of the media does not receive a notification email when (s)he comments on their own media or when they comment on a thread of their own media.

View how to allow users to edit their Media Notification Opt-out settings.

View how users can edit their Media and Thread Notification Opt-out settings.

Project Settings

First, the comment notification feature needs to be enabled and configured in the Project Settings.

SettingDescription
Media ModerationIf set to "Pre" (meaning that media, including comments, will be moderated before they are posted on the site), then the notification email is sent when the comment is approved. If set to "Post" (meaning that media, including comments, will be moderated after they are posted on the site), then the notification email is sent as soon as the comment is posted.
Media Comment NotificationsThis setting specifies if a system email is sent to the poster of a comment when that same file receives additional comments.
"Off" means no comment notification emails will be sent, ever.
"Send by default" means that comment notification emails will be sent for all users that have not opted out.
"User must opt-in" means that comment notification emails will only be sent to those that have explicitly opted in. Requires that this option exists in the user profile page.
Comment notification email templates are specified in the channel settings.
Thread Comment NotificationsThis setting specifies if a system email is sent to the poster of a comment when that same file receives additional comments.
"Off" means no comment notification emails will be sent, ever.
"Send by default" means that comment notification emails will be sent for all users that have not opted out.
"User must opt-in" means that comment notification emails will only be sent to those that have explicitly opted in. Requires that this option exists in the user profile page.
Comment notification email templates are specified in the channel settings.

How to Create the Thread Notification Email template

  • Open the application in your project
  • Select Email Templates
  • Create a new email and fill in the following fields:
    • Template Name - set the Template Name to 'Thread Notification Email'.
    • Wrapper Template - set to 'html' or 'text'
    • Subject - example: 'Someone else has commented'
    • Sender - example: 'no-reply@yourdomain.com'
  • Click Create
  • Enter the template contents (sample HTML email code is provided below)
  • Save the template

How to Assign the Thread Notification Email Template to the Comments Channel

The email template needs to be configured at the channel level. The primary purpose of this is to support multiple languages.

  • Create a channel named 'Comments', if it does not already exist. It will hold the comments being posted about media.
  • In the channeldetail page for the Comments channel, set the Thread Notification email, so that thread notifications can be sent to users who previously commented on that media.
    NB: The URL of the link to the opt-out notification page provided in this email will be for to the application that the email template is in.

How to Create the threadnotificationoptout page

  • Open the application in your project
  • Select Applications Templates
  • Create a new template and fill in the following fields:
    • Template Name - enter 'Thread Notification Opt Out'.
    • URL - enter 'threadnotificationoptout'
    • Wrapper Template - set to 'use default template'
    • Page type - set to 'generic'
    • Caching - set to 'no caching'
  • Click Create
  • Enter the template contents (sample HTML code is provided below)
  • Save the template

    In the threadnotificationoptout template, add the following:

<div class="boxlarge"> <div class="top"></div> <div class="inside"> <div class="rules"> <fm:If value="{$$get.fm_message}" comparison="=" compareTo="disabled_thread_notifications"> <h4>You have opted out of Thread Notifications.</h4> </fm:If> <p><a href="/home">View your homepage</a></p> </div> <br /> </div> <div class="bottom"></div> </div>

How to Allow Users to Edit Their Media (and Thread) Notification Opt-out Settings

In the application's "editprofile" template, add the following code which will allow the user to change their "Receive media notifications" setting.

<fm:If value="{$$media_notifications_default}" comparison="gt" compareTo="0" > <li class="label"> Receive media notifications? <select class="disable_media_notifications fmSelect" name="disable_media_notifications"> <option value="0" <fm:Switch value="{$$loggedinuser.disable_media_notifications}"><fm:Case value="0">selected="selected"</fm:Case></fm:Switch>>yes</option> <option value="1" <fm:Switch value="{$$loggedinuser.disable_media_notifications}"><fm:Case value="1">selected="selected"</fm:Case></fm:Switch>>no</option> </select> </li> </fm:If>

As a User, How to Edit Your Media Notification Opt-out Settings

Log in to the application, and in the editprofile page edit the setting for "Receive media notifications".
This setting enables and disables both the media and thread notification settings.

Supported Attributes

Name Description
author (String) - The first and last name of the user that wrote the comment.
author_firstname (String) - The first name of the user that wrote the comment.
author_id(Integer) - The id of the user that wrote the comment.
comment (String) - The comment that was posted.
comment_id (Integer) - The id of the comment that was posted.
comment_meta (Array) - The meta data of the comment that was written. Contains the URL that was used to create the comment. In order to be available in the mediadetail page, this metadata has to be passed as: $fileData[metadata][user][<url_key>] and is available in the template as {$$comment_meta.user.<url_key>}
email_recipient_firstname (String) - The first name of the recipient of the email.
media_id (Integer) - The id of the media that has been commented on.
media_owner_firstname (String) - The first name of the media owner.
media_owner_id (Integer) - The id of the owner of the media that has been commented on.
media_title(String) - The title of the media that has been commented on.
mediaorthread(String) - Signifies whether the email is for media or thread moderation. Can be either 'media' or 'thread'.

Supported Attributes: for Thread Notification Opt-out

mediaorthread (String) - Required - Signifies whether the email is for media or thread moderation. Can be either 'media' or 'thread'.
secret1 (String) - Required - The first encrypted string used to verify the email recipient for the media and thread notification opt-out emails.
secret2 (String) - Required - The second encrypted string used to verify the email recipient for the media and thread notification opt-out emails.
u (Integer) - Required - The user id of the email recipient. (The email recipient being the media owner)
vhostmaindomain (String) - Required - The domain of the application.

Email contents example

<table width="500" style="font-family:Arial;"> <tr> <td style="border:1px solid #ccc; padding: 10px;"> <table> <tr> <td> <h2 style="font-size:14px;">{$$email_recipient_firstname},</h2> <p style="font-size:12px;"> {$$author} just posted a comment on "{$$media_title}": </p> <p style=" font-size:14px;"> {$$comment} </p> <p>The URL of the comment is: {$$comment_meta.user.url} </p> </td> </tr> </table> </td> </tr> <tr> <td style="padding:10px; font-size:10px; color:#505050; text-align:center;"> Do more at <a href="http://{$$vhostmaindomain}/">http://{$$vhostmaindomain}</a> </td> </tr> <tr> <td style="padding:10px; font-size:10px; color:#505050; text-align:center;"> OPT OUT FROM THE NOTIFICATIONS AT: <BR /> {$$vhostmaindomain}/action/v2/{$$mediaorthread}notificationoptout?u={$$u}&s={$$secret1}&s2={$$secret2} </td> </tr> </table>

See Also: