Tell A Friend

This email is triggered by the tellafriend action in the user Actions section of the Application Settings.
The action must be called tellafriend and it must be selected in the Application Settings.
The attributes supported by the email must be selected as well, and are listed below.

To create the template follow these steps:

  • go to the application in your project
  • select Email Templates
  • create the desired email text/formatting
  • configure email options by clicking on the Info button and filling in the fields
  • save the template

Go to the communitygroupinfo page for the group and select the 'tellafriend' template name from the Email Template dropdown.
This will enable emails to be sent out to users using that email template.

Supported Attributes

NameDescription
firstnameThe first name of the recipient of the email.
messageThe message to be sent about the media.
projectidThe id of the project for the group.
midThe id of the media.
media_titleThe title of the media.
custom1The url of the media.

Example 1: The Template for the Email

<!-- sub_share --> <fm:Switch value="{$$email}"> <fm:Case value="true"> <span onclick="fmLightbox({'element':$('#emailtoafriend')}); return false;" class="icon email tool" title="Email a friend">{%share:emailHeader}</span> </fm:Case> </fm:Switch> <div id="emailtoafriend" style="display:none;"> <script type="text/javascript"> $(document).ready(function() { $('#emailform').fmValidateForm({ errorHandlers: [ function(element, message) { handleValidation(element, message); return false; } ] }); }); </script> <div class="formbox"> <fm:Form action="/action/v2/tellafriend" class="emailform" id="emailform" method="post" onsubmit="sendToAFriend(this); return false;" formType="simple"> <h5>{%forms:sendEmail}</h5> <input type="hidden" name="email" value="{%var:shareEmail}" /> <input type="hidden" name="mid" id="friendmid" value="{$$mid}"/> <input type="hidden" value="{$$lang}" name="language" id="language" /> <input type="hidden" id="sentfromtext" name="sentfromtext" value="{%forms:sentFromText}" /> <input type="hidden" value="http://{$$vhost}/{$$basepage}/{$$subpage}" name="custom1" id="custom1" /> <input type="hidden" value="http://{$$vhost}" name="custom2" id="custom2" /> <ul> <li class="label"><label for="emailfriend_name">{%forms:yourName}</label></li> <li><input type="text" title="{%forms:yourName}" name="name" id="emailfriend_name" value="<fm:IfLoggedIn>{$$loggedinuser.firstname} {$$loggedinuser.lastname}</fm:IfLoggedIn>" class="fmInput required"/></li> <li class="label"><label for="emailfriend_friendName">{%forms:friendsName}</label></li> <li><fm:Form_TextInput name="firstname[0]" id="emailfriend_friendName" title="{%forms:friendsName}" required="1" value="" class="fmInput"/></li> <li class="label"><label for="emailfriend_friendEmail">{%forms:friendsEmail}</label></li> <li><fm:Form_Email name="rmail[0]" id="emailfriend_friendEmail" title="{%forms:friendsEmail}" required="1" value="" class="fmInput email"/></li> <li class="label"><label for="emailfriend_message1">{%forms:emailMessage}</label></li> <li><fm:Form_TextArea name="message" id="emailfriend_message1" title="{%forms:emailMessage}" required="1" value="" rows="3" class="fmTextarea" style="height:auto;width:330px;"/></li> <li class="label clearfix"><br/><span class="fmButtonSm"><input type="submit" name="serialize" value="{%forms:send}"/></span></li> </ul> </fm:Form> <div class="thanksforemail" id="thanksforemail" style="display:none;"> <p>{%forms:successfullySent}.</p> </div> </div> </div>

Variables to pass to template for the example above:

  • $$email
  • $$mid
  • $$lang
  • $$basepage
  • $$subpage

*** NB ***
The Javascript function fmLightbox is located in: static/contest/v3/js/contest_v3.0.0.js

Example 2: The Email that is sent from the Template in Example 1

<table width="318"> <tr> <td> <center> <img src="http://www.filemobile.com/static/vidcom/v2/images/logo.png" alt="New Spark Media" /> </center> </td> </tr> <tr> <td style="border:1px solid #ccc; padding: 10px;"> <table> <tr> <td> <h2>Hey {$firstname}</h2> <fm:If value="{$message}"> <p> {$message} </p> </fm:If> <table width="318"> <tr> <td style="margin-top:10px; padding:10px; background-color:#e2e2e2;" width="318"> <s:FMModule_MediaDetail selectedproject="{$projectid}" subpage="{$mid}"> <a style="color:#1E597E;" href="{$custom1}-{$media_title}"><h3>{$$media_title}</h3></a> <p>{$media_message}</p> <a href="{$custom1}-{$media_title}"> <img src="{$media_publicUrl}/14" alt="{$media_title}" class="thumbnail"/> </a> <br/><br/> <a style="color:#1E597E;" href="{$$custom1}-{$$media_title}">{$custom1}-{$media_title}</a> </s:FMModule_MediaDetail> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td style="padding:10px; font-size:10px; color:#505050; text-align:center;"> New Spark Media's Media Community Application<br/> Check out more entries at <a style="color:#1E597E" href="{$$custom2}">{$$custom2}</a> </td> </tr> </table>

Variables to pass to template for the example above:

  • $firstname
  • $mesaage
  • $mid
  • $custom
  • $media_title
  • $media_message
  • $media_publicUrl
  • $custom1
  • $custom2

*** NB ***
Please note that some variables are preceded by 2 dollar signs. This is done to escape HTML.

See Also: