grptx / yii2-newsletter-mailup
Newsletter module to Yii2 - mailup integration
Installs: 75
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ^2
README
Newsletter module to Yii2 - mailup integration
with this module you can collect email address and store in the mailup newsletter service
Installation
Preferred way to install is through Composer:
php composer.phar require grptx/yii2-newsletter-mailup:^1.0
Or, you may add
"grptx/yii2-newsletter-mailup": "^1.0"
to the require section of your composer.json
file and execute php composer.phar update
.
Configuration
... 'modules' => [ 'newsletter' => [ 'class' => 'grptx\newsletter\mailup\Module', 'client_id'=>'<your-client-id>', 'client_secret'=>'<your-client-secret>', 'callback_uri'=>'http://127.0.0.1/index.php', 'username'=>'<your-username>', 'password'=>'<your-password>', 'group'=><your-recipents-group>, ], ... ]
Usage
Go to your application in your browser
http://localhost/pathtoapp/newsletter
- Or you can use an ajax call:
$.ajax({ method:'post', url:'/newsletter/default/ajax-call', data:{ email:'email', first_name:'first_name', last_name:'last_name' }, success:function(data) { console.log(data); if(data[result]=='ok') { console.log('success'); } else if(data['error']) { console.log(data['error']); } else { console.log('generic error'); } }, error:function(data) { console.log(data); } });