Easy Mailchimp Subscription module. With no form or jquery bullshit.
bower install angular-mailchimp-subscribe
- config :
You can retrieve your config form the mailchimp form exemple (on your mailchimp account: Lists > select a list > signup forms > embedded form, you will find this kind of uri in the code) :
http://<username>.<dc>.list-manage1.com/subscribe/post?u=<u>&id=<id>
angular.module('app', ['cg.mailchimp'])
.config(function (CgMailChimpServiceProvider) {
CgMailChimpServiceProvider.setConfig({
username: '<username>',
dc: '<dc>',
u: '<u>',
id:'<id>>'
});
})
-
Usage in controller
.controller('MyController', function (CgMailChimpService) {
$scope.chimp = {EMAIL:'[email protected]', FNAME: 'John', LNAME: 'Conor'}; $scope.subscribe = function () { CgMailChimpService.subscribe($scope.chimp).then(function (data) { console.log('[Debug] success', data); }, function (error) { console.log('[Debug] failed', error); });
});
Feel free to add feature you need.
MIT