Send bulk Email with mailchimp

I need to send promotional email and fetch there corresponding stats.Currently i am using Gibbon Gem but not able to create campaign through .Is there any way to create campaign and add bulk email in receiver through Gibbon Gem or there is any other Gem to work for same.I need all stat of a campaign like sent ,bounced, effective email.Which version Of Gibbon Gem should i use to create campaign and contact list through Api

Answers


Gibbon does allow you to create and trigger campaigns through the Mailchimp API v3. You have to use Gibbon version >= 2.1.3 to send campaigns, because there was a bug in the earlier versions.

Gibbon's readme file was recently updated with examples.

To create a campaign:

recipients = {
  list_id: list_id,
  segment_opts: {
    saved_segment_id: segment_id
  }
}
settings = {
  subject_line: "Subject Line",
  title: "Name of Campaign",
  from_name: "From Name",
  reply_to: "my@email.com"
}

body = {
 type: "regular",
 recipients: recipients,
 settings: settings
}

begin
  gibbon.campaigns.create(body: body)
rescue Gibbon::MailChimpError => e
  puts "Houston, we have a problem: #{e.message} - #{e.raw_body}"
end

To send a campaign:

gibbon.campaigns(campaign_id).actions.send.create

To get stats:

email_stats = gibbon.reports(campaign_id).retrieve["opens"]

Need Your Help

URLs not using GET or POST to retrieve a page

php apache

I have noticed that some websites use a url such as 'http://website.com/help' rather than using the conventional method of including a file through either a POST or a GET request.