Skip to content

Instantly share code, notes, and snippets.

@jnstq
Created January 27, 2011 12:59
Show Gist options
  • Save jnstq/798472 to your computer and use it in GitHub Desktop.
Save jnstq/798472 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'madmimi'
mimi = MadMimi.new("email", "key")
options = {
"promotion_name" => "Test Promotion",
"recipients" => "",
"from" => "",
"subject" => "Test Subject"
}
raw_html = "<html><head><title>My great promotion!</title></head><body>Body stuff[[tracking_beacon]]</body></html>"
transaction_id = mimi.send_html(options, raw_html)
puts "Mail sent, transaction #{transaction_id}"
puts "Sleeping 5 sec"
sleep 5
puts "Checking status"
request = mimi.send(:do_request, "https://madmimi.com/mailers/status/#{transaction_id}", :get)
puts "Email: #{request.inspect}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment