I want to send an email notification via mailchimp.
I read the doc and I wrote some code so that I get the list by using api.lists:
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'mailchimp'
@options = ["list_id" => "$list_id", "subject" => "test subject", "from_name" => "test name", "from_email" => "info@example.com"]
@content = ["html" => "<p> test content </p>"]
@type = 'regular'
@title = 'Test Newsletter Title'
api = Mailchimp::API.new("key")
puts "Your lists:"
api.lists['data'].each do |list|
puts "\t #{list['name']}"
end
campaignCreate:
I create a campaign like this:
api.campaignCreate(@type, @title, @content)
When I create a campaign by using the above then I get the following error: wrong number of arguments (4 for 2)
I want to send a notification email. How can I do that?
I done it, using this