X hide

Magento Invitations v1.x Developer's Guide & API Reference

From Plumrocket Documentation

You are viewing:  Invitations-32.png  Invitations

The getUrlWithInviter function allows you to get a URL with an invite parameter.

Using a URL like this, you can be sure that the users who follow this link to access the site, will be recognized as your invitees by the system. In order to add the invite parameter to any URL, you should add the following data in the end of href parameter:

<?php echo '?inviter='.$this->helper('invitations')->getCurrentCustomerId() ?>

In order to get the URL with invite parameter, you should invoke

<?php $url = Mage::helper('invitations')->getUrlWithInviter($route, $params, $customerId) ?>

The getUrlWithInviter method is similar to the Mage::getUrl method (More details on this method can be found here). The only difference is the third optional parameter $customerId; if it is not indicated, the current user ID will be used automatically.

Below you will find an example to be used in AddThis:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style " addthis:url="<?php echo Mage::helper('core/url')->getCurrentUrl()?><?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) echo '?inviter='.$cId ?>">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=YOUR_PUBID"></script>
<!-- AddThis Button END -->

Below you will find an example how to create сurrent url with invite parameter input:

<input name="current_url" value="<?php echo Mage::helper('core/url')->getCurrentUrl()?><?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) echo '?inviter='.$cId ?>" />

Below you will find an example how to create custom url with invite parameter input:

<input name="custom_url" value="http://mydomain.com/<?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) echo '?inviter='.$cId ?>" />

Setting Redirect for Invitee from an Invite Email

Here's the step by step instructions on how to redirect invitee to the needed page from invite email:

1. On your server, please copy the file:


into the folder with your theme:


2. Within the copied file - please find the code:

window.location = '<?php echo $this->getUrl() ?>';

3. Replace the original code with this code:

window.location = 'http://yourstore.com/some-page.html';

where 'yourstore.com/some-page.html' is the page you want to redirect the invitee to.

API Reference

Some of the services require additional setup in order to import address books. Please click on the links below to setup your personal API for each service.
Facebook address book configuration Gmail address book configuration Yahoo address book configuration
Facebook API Gmail API Yahoo API

Invitations Extension for Magento Invitations Extension for Magento

Buy Magento Invitations Extension on Plumrocket Store
Click below to check key features of this extension, view live demo and screenshots: