PHP code example of mrstroz / yii2-salesmanago

1. Go to this page and download the library: Download mrstroz/yii2-salesmanago library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mrstroz / yii2-salesmanago example snippets


'components' => [
    // ...
    'salesmanago' => [
        'class' => 'mrstroz\salesmanago\Salesmanago',
        'clientId' => 'xxxxxx',
        'apiKey' => 'xxxxxx',
        'apiSecret' => 'xxxxxx',
    ],
]

$salesmanago = Yii::$app->salesmanago;
$result = $salesmanago->call('contact/upsert',[
    contact' => [
        'email' => '[email protected]',
        'state' => 'CUSTOMER',
    ],
    'owner' => '[email protected]',
    'tags' => [
        'TAG'
    ],
    'properties' => array('page' => 'newsletter'),
    'lang' => 'PL',
    'useApiDoubleOptIn' => true,
    'forceOptIn' => true,
    'forceOptOut' => false,
    'forcePhoneOptIn' => true,
    'forcePhoneOptOut' => false
    ]
);