UniSender Integration with ShopCMS

Integration with ShopCMSPlug-in for integration of UniSender and ShopCMS allows to automatically add contact info of your website’s new registered users to UniSender and to transfer lists of existing users to UniSender.

When transferring data, you may select the fields required for transfer (for example, transfer user names for campaign personalization or phone numbers for SMS campaigns).

Integration with ShopCMS

Installation and support

To install the module, decompress the archive into website’s root folder and make additions to the following files:

1. Add page handler for админки: open \core\includes\admin\modules.php and after the line

array("id"=>"yandex", "name"=>"Yandex.Market" ),

add

/* unisender */
array("id"=>"unisender", "name"=>"Export ShopSMS contacts to UniSender" )

2.Create a new paragraph in админки menu: openx:\home\shopcms\www\core\tpl\admin\menu.tpl.html and after the line

 
{$smarty.const.STRING_AFFILIATE_PROGRAM}

add

 
{$smarty.const.STR_UNISENDER_MENU}

3.Add texts: open\core\languages\russian.php file and add, at the end or beginning of the file

/* unisender */	
include('core/modules/unisender/languages/russian.php');

4.Add a new user to the campaign list at the time of registration: at the beginning of the file\core\functions\registration_functions.php before function

function regRegisterAdmin( $admin_login, $admin_pass )

add

include('core/modules/unisender/config/config.php');

after the lines

db_query("insert into ".CUSTOMERS_TABLE.
                "( Login, cust_password, Email, first_name, last_name, 
                subscribed4news, reg_datetime, CID, custgroupID, affiliateID, 
                ActivationCode )". "values( '".xToText(trim($login))."', 
                '".xEscSQL(trim($cust_password))."', 
                '".xToText(trim($Email))."', ".
                " '".xToText(trim($first_name))."', '".xToText(trim($last_name))."', 
                '".(int)$subscribed4news."', '".xEscSQL(get_current_time())."', ".
                        (int)$currencyID.", ".(int)$custgroupID.", 
                        ".xEscSQL(trim($affiliateID)).", 
                        '".xEscSQL(trim($ActivationCode))."' )" );

add

/* ---> UniSender */
	if (!CONF_ENABLE_REGCONFIRMATION){
	    $aConfigUnisender = unserialize(CONFIG_UNISENDER);
	    if ($aConfigUnisender['new_user']){
		$sName = xToText(trim($login));
		$first_name=xToText(trim($first_name));
		$last_name=xToText(trim($last_name));
		if (!empty($first_name) or !empty($last_name)) {
		    $aName = array();
		    if ($first_name != '')
			$aName[] = $first_name;
		    if ($last_name != '')
			$aName[] = $last_name;

		    $sName = implode(' ', $aName);
		}	    
		UniSendSubscribe($aConfigUnisender['get_lists'], 
		                 xToText(trim($Email)), $sName);
	    }
	}
	/* <--- UniSender */

In function regActivateCustomer($_CustomerID) after

db_query($sql);

add

/* ---> UniSender */
	$aConfigUnisender = unserialize(CONFIG_UNISENDER);
	if ($aConfigUnisender['new_user']){
	    $sName = xToText(trim($login));
	    $first_name=xToText(trim($first_name));
	    $last_name=xToText(trim($last_name));
	    if (!empty($first_name) or !empty($last_name)) {
		$aName = array();
		if ($first_name != '')
		    $aName[] = $first_name;
		if ($last_name != '')                                                                                                
		    $aName[] = $last_name;

		$sName = implode(' ', $aName);
	    }	    
	    UniSendSubscribe($aConfigUnisender['get_lists'], 
	                     xToText(trim($Email)), $sName);
	}
	/* <--- UniSender */

For technical support and consultations on the plug-in’s installation and customization, please contact its author. The module was developed and tested on ShopCMS 3.1.