Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8963457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:21:37+00:00 2026-06-15T16:21:37+00:00

I want to send an email notification via mailchimp. I read the doc and

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:21:38+00:00Added an answer on June 15, 2026 at 4:21 pm

    I done it, using this

     $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
     $LOAD_PATH.unshift(File.dirname(__FILE__))
     require 'mailchimp'
     api = Mailchimp::API.new("api-key")
     @content =  {"html"=>"<p> test content </p>","text"=> "test"}
     api.lists['data'].each do |list|
       @options =  {"list_id"=> list['id'], "subject"=>"test subject", "from_name"=>"test name", "from_email"=>"xyz@test.net", "template_id" => "xxxx"}
       campaign = api.campaignCreate({"type"=>"regular", "options" => @options, "content"=> @content})
       api.campaignSendNow({"cid" => campaign})
     end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to send an email to user after he sign-up with code.for ex
i want to write application who send email using outlook and i found this
I'm developing on CakePHP 2.0. I'm using CakeMail to send some notification emails. However,
I've events table in Oracle database. I want to send email notification whenever a
Here's my problem I have some code and I'm using it to send an
I want send a email by Email Class in codeigniter with gmail, but i
I want to send email with my gmail account, I gave it a try,
I want to send email through Java (Any email like from yahoo, gmail, or
In my application i want send a email to one account.in one button click
I am new with cron job in php,basically i want to send email to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.