Backbench Docs
  • Introduction
  • Getting Started
    • BBLANG
    • Node
    • Python
    • Go
  • Backbench Features and UI workflow
  • API Reference
    • BBLANG
    • Node
    • Python
    • Go
  • 3rd Party Integrations
    • Login using Facebook
    • Login using Google
    • Login with Twitter
    • Login using LinkedIn
    • Connection with MongoDB
    • Connection with MySQL
    • Geo Location Integration
    • Integration with AWS S3
    • Integration with Google Cloud Storage
    • Integration with Razorpay
    • Integration with Stripe
    • Integration with Mailchimp
    • Integration with Segment
    • Sending Emails with SendGrid
    • Sending Emails with Mailgun
    • Sending SMS with Twilio
    • Sending Push Notification with Pushwoosh
  • Troubleshooting and support
    • CNAME Support
    • FAQS
    • Error Codes
  • Testing
Powered by GitBook
On this page
  • What You'll Need
  • Backend
  1. 3rd Party Integrations

Integration with Mailchimp

PreviousIntegration with StripeNextIntegration with Segment

Last updated 6 years ago

What You'll Need

Backbench account - , the personal account will always remain free to use.

Mailchimp account- sign up, create a list and add recipient into the list, create your Campaign and customize your content of email also add the list to your campaign.

Backend

  1. Select +, in the upper right corner to create a Module. For example, say "mailchimp.js" and select CREATE or hit Enter.

  2. Copy and paste the code module from below.

  3. Replace USER NAME, PASSWORD and API key from mailchimp setting section (create a new api key using create button).

  4. Select save.

var request = require("request");
module.exports.endpoint = function(req, cb){
var options = { 
method: 'POST',url:
'https://us12.api.mailchimp.com/3.0/campaigns/[campaign_id]/actions/test',
  headers: { 
     content_type: 'application/json'
      },
  auth:{
      username:'username', 
     password: 'api_key'
    },
  body: { 
    test_emails: [ 'TO Mail' ],
    send_type: 'html' 
  },
  json: true 
};

request(options, function (error, response, body) {
  if (error) {
      cb({res:error})
  }
  console.log(body);
  cb({d:body});
});
 
}; 
chimp:handler(req)->{
bb:http:post({
url: 'https://us12.api.mailchimp.com/3.0/campaigns/[campaign_id]/actions/test',
  headers: { 
   content_type: 'application/json'
      },
  Auth:{
   username:'username', 
   password: 'api_key'
    },
  
 body: { 
         test_emails: [ 'TO EMAIL' ],
         send_type: 'html' 
        }
 }) 
 },

 redirect:ghandler(req, url)-> {
    return {
        status: 302,
        headers: {
            Location: url
        }
    }
}
Sign Up