Created
January 27, 2011 12:59
-
-
Save jnstq/798472 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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