Send to a friend

Word of mouth is a great marketing method and adding a 'send to a friend' feature to your website can be a powerful way to increase sales on your store through viral marketing.

When combined with a referral programme, such as in the example above, you can provide a great incentive for your customers to refer their friends and for those they're referring to make the purchase.


How does the feature work

You'll need to place a 'send to a friend' form on your website.

This can either be directly on the product page or you can display a small information section and then the user clicks a button to bring up the email that they want to send (like in the example below).

The email that's sent to the referred friend can be customised in your account in the same way as other emails.

To combine the feature with a referral programme you can use the reward points app. A referring customer will need to be logged into a customer account in order for their referral link to be generated. If you're installing the extension code yourself this is described in more detail below.


Installing the extension

Select 'apps and extensions' from the left menu and then 'available extensions'. Find the 'send to a friend' extension and click to activate it on your account.

Once the extension is activated you'll then need to add the relevant code to your website's files (described below). Adding the code will place the code on your website and allow for the display of the email. To add the relevant code you'll need to use the page editor, alternatively you can click the 'request installation' button and we'll install the code for you (a small charge will be made for the installation, which is listed on the extension page).

Installation by us

If you choose to have us install the extension for you, as part of the installation process we'll design how the feature will be displayed.


GDPR compliance

The new GDPR regulations come into effect on 25th May 2018. You can read more about them here. The 'send to a friend' feature described above is GDPR Compliant because your website is merely acting as the email sender (the recipient email address of the 'send to a friend' is not stored or captured through your website). You can read more here.


Self installation

The code below comes with no styling so you'll need to use CSS in order to make the form appear nicely.

Instructions on how to make the email form appear in a pop-up (like our example below) are not included either. To do so you'll need to use some HTML/JS to create a popup. If you're not familiar with this process, W3schools has a tutorial which you can follow (you will need HTML/CSS/JS experience).

<form action="{{ global.current_url }}" method="post">
    <input type="text" name="email_address">
    <textarea cols="30" rows="5" name="message"></textarea>
    <input type="text" name="{{ global.honeypot_field_name }}" autocomplete="off" class="hidden">
    {% if recommendation_recaptcha %}
        <div class="g-recaptcha"></div>
    {% endif %}
    <input type="hidden" name="redirect_path" value="/thanks">
    <input type="hidden" name="redirect_message" value="The email has been sent">
    <button name="send_recommendation_email" value="1">
        Send
    </button>
</form>

The code displayed above is the code required that generates the form to send the referral email.

Displaying Google's reCAPTCHA is a requirement for the form. The user will need to pass the reCAPTCHA test in order for the form to submit (this is to prevent abuse of the system by bots). You can read more about reCAPTCHA here.

Once the form has been submitted, you have two options for showing the customer a success message (to confirm the message has been sent). You should only implement one of these methods.

<input type="hidden" name="redirect_path" value="/thanks">

The code above will redirect the customer to another page. In this example, a page located at /thanks.

<input type="hidden" name="redirect_message" value="The email has been sent">

The code above will keep the user on the current page (and refresh it) and show a success message from the bottom of the screen.

The message field, as shown below

<textarea cols="30" rows="5" name="message"></textarea>

Allows the user to enter the message that's sent with the email. You can predefine the message if you want to.

If you'd like to include details about the product then you can include details using the product object, e.g. {{ product.url }} will output the URL of the product that's being referred.


Implementing a referral link

The example at the top of this page shows how the feature can be combined to give the referred customer a discount off their order. The referring customer will also receive a bonus too.

To implement this, you'll need to have the reward points app installed in your account and have it setup.

You can then write details about what each customer will get in reward for their friend making a purchase.

When using the referral scheme, each registered customer has a unique referral link which they give to their friends. This needs to be included in the email that's sent to the customer (in the message field).

The referring friend will need to be logged into a customer account in order for the referral URL to be generated, you can detect this using {% if global.customer.id %} (which will return TRUE if they are logged in).

<textarea cols="30" rows="5" name="message">Please check this out {{ product.url }}?{{ global.customer.referral_scheme_url|replace({'http://www.domain.com/?': '' }) }} and get £5 off your first order.</textarea>

In the example above, the referred customer is getting £5 off their first order.

The {{ product.url }} variable will create the link of the product, but without the referring customer's unique referral URL. In order to add this, we're using some additional code (and removing the domain name from the variable with the |replace filter (because the product.url variable already contains this). You'll need to substitute domain.com for your own domain.


Customising the referral email

The email that's sent to the friend can be customised like any other email that's sent out from your website. Follow the instructions here.

The email name is referral email.

The email has full access to the product object so other details about the product (like the image or price) can be included in the email.

The {{ message }} variable is used in the email to output the contents of the message entered by the referring friend.