Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.35 KB

README.md

File metadata and controls

62 lines (40 loc) · 1.35 KB

Angular mailchimp subscribe

Easy Mailchimp Subscription module. With no form or jquery bullshit.

Install

bower install angular-mailchimp-subscribe

Usage

  • 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);
              });
    

    });

Contribution

Feel free to add feature you need.

Licence

MIT