{"id":329,"date":"2020-02-28T16:04:38","date_gmt":"2020-02-28T16:04:38","guid":{"rendered":"http:\/\/wiki2.plumserver.com\/knowledge-base\/magento-invitations-v1-x-developers-guide-and-api-reference"},"modified":"2021-07-23T12:27:19","modified_gmt":"2021-07-23T16:27:19","slug":"magento-invitations-v1-x-developers-guide-and-api-reference","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide","title":{"rendered":"Magento 1 Invitations v1.x Developer Guide &#038; API Reference"},"content":{"rendered":"\n<p>In this developer documentation for the\u00a0<a href=\"\/magento-1-invitations\">Magento Invitations Extension<\/a>, you will find step-by-step instructions, sample code, and API references to fully customize your plugin.<\/p>\n\n\n\n<p>The getUrlWithInviter function allows you to get a URL with an invite parameter.<\/p>\n\n\n\n<p>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:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?php echo '?inviter='.$this->helper('invitations')->getCurrentCustomerId() ?><\/code><\/pre><\/div>\n\n\n\n<p>In order to get the URL with invite parameter, you should invoke<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?php $url = Mage::helper('invitations')\n    ->getUrlWithInviter($route, $params, $customerId) ?><\/code><\/pre><\/div>\n\n\n\n<p><br>The getUrlWithInviter method is similar to the Mage::getUrl method. The only difference is the third optional parameter $customerId; if it is not indicated, the current user ID will be used automatically.<\/p>\n\n\n\n<p>Below you will find an example to be used in AddThis:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;!-- AddThis Button BEGIN -->\n&lt;div class=\"addthis_toolbox addthis_default_style \" addthis:url=\"&lt;?php \n    echo Mage::helper('core\/url')->getCurrentUrl()?>\n    &lt;?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) \n        echo '?inviter='.$cId ?>\">\n        &lt;a class=\"addthis_button_facebook_like\" fb:like:layout=\"button_count\">&lt;\/a>\n        &lt;a class=\"addthis_button_tweet\">&lt;\/a>\n        &lt;a class=\"addthis_button_pinterest_pinit\">&lt;\/a>\n&lt;\/div>\n&lt;script type=\"text\/javascript\" \n    src=\"\/\/s7.addthis.com\/js\/30\/addthis_widget.js#pubid=YOUR_PUBID\">&lt;\/script>\n&lt;!-- AddThis Button END --><\/code><\/pre><\/div>\n\n\n\n<p><br>Below you will find an example how to create ?urrent url with invite parameter input:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;input name=\"current_url\" value=\"&lt;?php \n    echo Mage::helper('core\/url')->getCurrentUrl()?>\n    &lt;?php if ($cId = $this->helper('invitations')->getCurrentCustomerId()) \n    echo '?inviter='.$cId ?>\" \/><\/code><\/pre><\/div>\n\n\n\n<p><br>Below you will find an example how to create custom url with invite parameter input:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;input name=\"custom_url\" value=\"http:\/\/mydomain.com\/&lt;?php \n    if ($cId = $this->helper('invitations')->getCurrentCustomerId()) \n        echo '?inviter='.$cId ?>\" \/><\/code><\/pre><\/div>\n\n\n\n<h2>Setting Redirect for Invitee from an Invite Email<\/h2>\n\n\n\n<p>Here&#8217;s the step by step instructions on how to redirect invitee to the needed page from invite email:<\/p>\n\n\n\n<p>1. On your server, please copy the file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-\">\/app\/design\/frontend\/base\/default\/template\/invitations\/accept.phtml<\/code><\/pre><\/div>\n\n\n\n<p>into the folder with your theme:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-\">\/app\/design\/frontend\/PACKAGE_NAME\/THEME_NAME\/template\/invitations\/accept.phtml<\/code><\/pre><\/div>\n\n\n\n<p>2. Within the copied file &#8211; please find the code:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-jscript\">window.location = '&lt;?php echo $this->getUrl() ?>';<\/code><\/pre><\/div>\n\n\n\n<p>3. Replace the original code with this code:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-jscript\">window.location = 'http:\/\/yourstore.com\/some-page.html';<\/code><\/pre><\/div>\n\n\n\n<p>where &#8216;yourstore.com\/some-page.html&#8217; is the page you want to redirect the invitee to.<\/p>\n\n\n\n<h2>API Reference<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/docs\/magento-1-invitations\/v1\/integrations\/facebook\"><img src=\"\/docs\/wp-content\/uploads\/2020\/05\/Facebook-api-icon-54.png\" alt=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"\/docs\/magento-1-invitations\/v1\/integrations\/facebook\">Facebook API<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/docs\/magento-1-invitations\/v1\/integrations\/gmail\n\"><img src=\"\/docs\/wp-content\/uploads\/2020\/05\/Gmail-api-icon-54.png\" alt=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"\/docs\/magento-1-invitations\/v1\/integrations\/gmail\n\">Gmail API<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/docs\/magento-1-invitations\/v1\/integrations\/yahoo\n\"><img src=\"\/docs\/wp-content\/uploads\/2020\/05\/Yahoo-api-icon-54.png\" alt=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"\/docs\/magento-1-invitations\/v1\/integrations\/yahoo\n\">Yahoo API<\/a><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this developer documentation for the\u00a0Magento Invitations Extension, you will find step-by-step instructions, sample code, and API references to fully customize your plugin. 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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Magento 1 Invitations v1.x Developer Guide &#038; API Reference&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[227],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento Invitations v1.x Developer Guide &amp; API Reference - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"In this developer documentation for the\u00a0Magento Invitations Extension, you will find step-by-step instructions, sample code, and API references to fully\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 1 Invitations v1.x Developer Guide &amp; API Reference\" \/>\n<meta property=\"og:description\" content=\"In this developer documentation for the\u00a0Magento Invitations Extension, you will find step-by-step instructions, sample code, and API references to fully\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-28T16:04:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-23T16:27:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2020\/05\/Facebook-api-icon-54.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Magento Invitations v1.x Developer Guide & API Reference - Plumrocket Documentation","description":"In this developer documentation for the\u00a0Magento Invitations Extension, you will find step-by-step instructions, sample code, and API references to fully","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide","og_locale":"en_US","og_type":"article","og_title":"Magento 1 Invitations v1.x Developer Guide & API Reference","og_description":"In this developer documentation for the\u00a0Magento Invitations Extension, you will find step-by-step instructions, sample code, and API references to fully","og_url":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide","og_site_name":"Plumrocket Documentation","article_published_time":"2020-02-28T16:04:38+00:00","article_modified_time":"2021-07-23T16:27:19+00:00","og_image":[{"url":"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2020\/05\/Facebook-api-icon-54.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide#primaryimage","inLanguage":"en-US","url":"\/docs\/wp-content\/uploads\/2020\/05\/Facebook-api-icon-54.png","contentUrl":"\/docs\/wp-content\/uploads\/2020\/05\/Facebook-api-icon-54.png"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide","name":"Magento 1 Invitations v1.x Developer Guide & API Reference - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide#primaryimage"},"datePublished":"2020-02-28T16:04:38+00:00","dateModified":"2021-07-23T16:27:19+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20"},"description":"In this developer documentation for the\u00a0Magento Invitations Extension, you will find step-by-step instructions, sample code, and API references to fully","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1\/devguide#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento Extensions","item":"https:\/\/plumrocket.com\/magento-1-extensions"},{"@type":"ListItem","position":2,"name":"Magento Invitations","item":"https:\/\/plumrocket.com\/magento-1-invitations"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-1-invitations"},{"@type":"ListItem","position":4,"name":"v1","item":"https:\/\/plumrocket.com\/docs\/magento-1-invitations\/v1"},{"@type":"ListItem","position":5,"name":"Developer Guide"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/72392a92ae750c66560be284502b6676?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/72392a92ae750c66560be284502b6676?s=96&d=mm&r=g","caption":"Plumrocket"},"sameAs":["https:\/\/plumrocket.com\/docs"]}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/329"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=329"}],"version-history":[{"count":1,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/329\/revisions"}],"predecessor-version":[{"id":22636,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/329\/revisions\/22636"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}