Skip to content
This repository
Browse code

Added chapter on MailChimp...for now.

  • Loading branch information...
commit bf96274e878691c3c65731e60efeb6c81753eb4c 1 parent 9afd6d3
Joshua Holbrook jesusabdullah authored

Showing 1 changed file with 141 additions and 0 deletions. Show diff stats Hide diff stats

  1. +141 0 chapters/mailchimp.md
141 chapters/mailchimp.md
Source Rendered
... ... @@ -0,0 +1,141 @@
  1 +<a name="#mailchimp" />
  2 +# Mailchimp Integration in Nodejitsu
  3 +
  4 +Nodejitsu features integration with [MailChimp](http://mailchimp.com). What is
  5 +MailChimp? In their [own words](http://mailchimp.com/about/):
  6 +
  7 + MailChimp makes it easy to design exceptional email campaigns, share them on
  8 + social networks, integrate with web services you already use, manage
  9 + subscribers and track your results. You'll love mixing and matching
  10 + MailChimp's templates, features and integrations to suit your needs—think of
  11 + it as your own personal newsletter publishing platform.
  12 +
  13 +But what about integration? MailChimp integration with Nodejitsu means that you
  14 +can interact with your MailChimp lists using the same Nodejitsu API that you use
  15 +to interact with your apps!
  16 +
  17 +## Getting Started
  18 +
  19 +In order to set up the MailChimp integration, you have to
  20 +[sign up for MailChimp](http://mailchimp.com/signup) at
  21 +[their web site](http://mailchimp.com):
  22 +
  23 +![](./fig/signup_page.png)
  24 +
  25 +Once you sign up for MailChimp, they can help you get your bearings so you can
  26 +get to managing e-mail campaigns quick:
  27 +
  28 +![](./fig/dashboard_help.png)
  29 +
  30 +But, in order to integrate with Nodejitsu, what you should do is go to the
  31 +API keys page from the side-menu:
  32 +
  33 +![](./fig/api_keys_dropdown.png)
  34 +
  35 +Here, you can see an API key:
  36 +
  37 +![](./fig/api_keys.png)
  38 +
  39 +All you have to do to link your MailChimp account with your Nodejitsu account
  40 +is to copy-and-paste this API key into Nodejitsu's web application interface:
  41 +
  42 +!![](./fig/nodejitsu_dashboard_api_key.png)
  43 +
  44 +Now you're good to go! Nodejitsu reports that I have one mailing list, and that
  45 +the two subscribers are my mother and myself.
  46 +
  47 +!![](./fig/nodejitsu_dashboard.png)
  48 +
  49 +## Interacting with your lists via the Nodejitsu JSON API: A Broad Overview
  50 +
  51 +Like the rest of Nodejitsu's features, addon functionality can be accessed using
  52 +Nodejitsu's JSON API. For example, here's what happens when I
  53 +`GET /addons/:user-id`, minus some private information:
  54 +
  55 + josh@pidgey:~$ curl --user 'jesusabdullah:█████████████' http://api.nodejitsu.com/addons/jesusabdullah/ | pretty-json
  56 + % Total % Received % Xferd Average Speed Time Time Time Current
  57 + Dload Upload Total Spent Left Speed
  58 + 100 332 100 332 0 0 53 0 0:00:06 0:00:06 --:--:-- 3192
  59 + { _id: 'jesusabdullah',
  60 + username: 'jesusabdullah',
  61 + 'password-salt': '████████████',
  62 + password: '████████████████████████████████',
  63 + email: 'josh.holbrook@gmail.com',
  64 + 'addons-mailchimp-apikey': '████████████████████████████████-us2',
  65 + _rev: '3-2df3731e8cc48d8e11511096dad140e8',
  66 + status: 'active',
  67 + inviteCode: '███████████',
  68 + resource: 'User' }
  69 +
  70 +In order to interact with the MailChimp add-on in particular, use the
  71 +`/addons/:user-id/signups` resource:
  72 +
  73 + josh@pidgey:~$ curl --user 'jesusabdullah:█████████████' http://api.nodejitsu.com/addons/jesusabdullah/signups | pretty-json
  74 + % Total % Received % Xferd Average Speed Time Time Time Current
  75 + Dload Upload Total Spent Left Speed
  76 + 0 0 0 0 0 0 0 0 --:--:-- --:--100 695 100 695 0 0 732 0 --:--:-- --:--:-- --:--:-- 3390
  77 + { lists:
  78 + { total: 1,
  79 + data:
  80 + [ { id: 'f3b7d6450c',
  81 + web_id: 646837,
  82 + name: 'Example Mailing List',
  83 + date_created: '2011-07-26 01:06:42',
  84 + email_type_option: false,
  85 + use_awesomebar: true,
  86 + default_from_name: 'Joshua Holbrook',
  87 + default_from_email: 'josh.holbrook@gmail.com',
  88 + default_subject: 'Relevant AND Non-Spammy!',
  89 + default_language: 'en',
  90 + list_rating: 0,
  91 + stats:
  92 + { member_count: 2,
  93 + unsubscribe_count: 0,
  94 + cleaned_count: 0,
  95 + member_count_since_send: 3,
  96 + unsubscribe_count_since_send: 0,
  97 + cleaned_count_since_send: 0,
  98 + campaign_count: 0,
  99 + grouping_count: 0,
  100 + group_count: 0,
  101 + merge_var_count: 0,
  102 + avg_sub_rate: null,
  103 + avg_unsub_rate: null,
  104 + target_sub_rate: null,
  105 + open_rate: null,
  106 + click_rate: null },
  107 + modules: [] } ] } }
  108 +
  109 +You can use the list ID to access the particular list information with
  110 +`GET /addons/:user-id/signups/:list-id/`:
  111 +
  112 + josh@pidgey:~$ curl --user 'jesusabdullah:█████████████' http://api.nodejitsu.com/addons/jesusabdullah/signups/f3b7d6450c | pretty-json
  113 + % Total % Received % Xferd Average Speed Time Time Time Current
  114 + Dload Upload Total Spent Left Speed
  115 + 0 0 0 0 0 0 0 0 --:--:-- --:--100 154 100 154 0 0 182 0 --:--:-- --:--:-- --:--:-- 785
  116 + { total: 2,
  117 + data:
  118 + [ { email: 'holbrook@█████████.net',
  119 + timestamp: '2011-07-26 01:08:11' },
  120 + { email: 'josh@nodejitsu.com',
  121 + timestamp: '2011-07-26 01:09:11' } ] }
  122 +
  123 +This confirms that Mom is in my example list.
  124 +
  125 +## More API Commands:
  126 +
  127 +* **Retrieve your API key:**
  128 +
  129 + GET /addons/:user-id/signups/apikey/
  130 +
  131 +* **Set your API key:**
  132 +
  133 + PUT /addons/:user-id/signups/apikey/
  134 +
  135 +* **Subscribe to a list:**
  136 +
  137 + POST /addons/:user-id/signups/:list-id/subscribe/
  138 +
  139 +* **Unsubscribe from a list:**
  140 +
  141 + POST /addons/:user-id/signups/:list-id/unsubscribe/

0 comments on commit bf96274

Please sign in to comment.
Something went wrong with that request. Please try again.