'Email this page to a Friend' functionality

Knowledgebase Articles: 'Email this page to a Friend' functionality

You can include the 'Email this page to a Friend' functionality on any of your site pages by adding specific HTML/Javascript code. In the code provided the AddThis functionality is used.
 

Email a Friend: 1st option

When a visitor clicks the 'Email a Friend' button, the following window is opened:

To display this button, the following code should be added to a HTML page section added to the relevant site page:

<a title="email this to a friend" onclick="return addthis_sendto('email');" href="#"><div style="float: right; background: #fff; border: 1px solid #666; color:#333; padding: 5px; text-transform:uppercase; font-weight: bold;">Email a friend</div></a>

<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>

 

In our example we have followed these steps:

1. Go to Manage Website > Edit Website

2. Select the Product Details page in the Website Map tree and switch to the Edit Page tab

3. Drag a HTML page section to the Product Details page and place it above the Breadcrumb page section

 

 

Email a Friend: 2nd option

The 'Email a Friend' button will be of the same design as all site buttons.

When a visitor clicks the 'Email a Friend' button, the same window as specified in the first method is opened.

To display this button, complete the following steps:

1. Go to Manage Website > Edit Website

2. Select the Product Details page in the Website Map tree and switch to the Edit Page tab

3. Drag a HTML page section to the Product Details page and place it under the Product Details page section

4. Add the code to the HTML page section:

<script type="text/javascript">
$(document).ready(function(){

var priceBlock = $(".productPriceBlock").html();
button = '<a title="email this to a friend" onclick="return addthis_sendto(\'email\');" href="#"><input class="bigBtn" value="Email a friend" type="button" style="float: left;" /></a>';
$(".productPriceBlock").html(button + priceBlock);

});

</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>

 

 

The Email Content

The email generated using 'Email a Friend' will include the URL and title of the page the button is on. The page title will be displayed in the email subject; the page URL is contained in the email body, just after the Note (if any content was specified). 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.