PHP code example of ethercreative / yii2-sendgrid-unsubscribe

1. Go to this page and download the library: Download ethercreative/yii2-sendgrid-unsubscribe 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/ */

    

ethercreative / yii2-sendgrid-unsubscribe example snippets


return [
	'modules' => [
		'unsubscribe' => [
			'class' => 'ethercreative\unsubscribe\Module',

			// the following are optional

			// default group to unsubscribe from
			'default' => 70,

			// flash message options
			'flashMessage' => 'Your email address has successfully been unsubscribed',
			'flashGroup' => 'unsubscribe-success',

			// where to redirect to, after success
			// defaults to `Url::home()`
			'redirect' => ['/site/login'],

			// if you want to hide the IDs of your suppression groups, use `groups` to convert
			// the following will allow you to use
			//     `[email protected]&group=messages`
			//     `[email protected]&group=Y30JOMJjA7V7bcAC`
			'groups' => [
				'messages' => 70,
				'Y30JOMJjA7V7bcAC' => 80,
			],
		],
		// ...
	],
	// ...
];

Url::to(['/unsubscribe', 'email' => $email, 'group' => $group], true);

php composer.phar