just simpler this way
class Mailerit < ActiveResource::Base headers["X-MailerItKey"] = "YOUR_API_KEY_GOES_HERE" self.site = "http://mailerit.com"; end
# call from anywhere in your application - models, controllers, views, libs ... Mailerit.create(:email_template_name => "MailerItTest", :smtp_setting_name => "DefaultSettings", :params => {:email => "myemail@blarg.com", :username => "someonesusername", :another_var => "somevalue"}) # :email_template_name (optional) # set to a string representing the name of the email template to use # if omitted, the first email template under your account will be used # :smtp_setting_name (optional) # set to the string representation of the name of the smtp settings to use # if omitted, the default smtp settings under your account will be used # if no default, it will use the first smtp settings under your account. # :params (optional) # set to a hash of key/value pairs you would like Mailer It to fill in through out the email template # required if you have any variables that need a value in your template. # for example, if you template contains #<variable1>, then you will want to pass that key/value pair to params # like this :params => {:varialbe1 => "the value"}. # may be omitted if no variables.
curl -i -X POST \ -H "Content-Type: application/xml" \ -H "X-MailerItKey: YOUR_KEY_GOES_HERE" \ -d "<mailerit> <email_template_name>notice_to_dev</email_template_name> <params> <email>myemail@blarg.com</email> <username>someonesusername</username> <another_var_used_in_template>somevalue</another_var_used_in_template> </params> </mailerit>" http://mailerit.com/mailerits.xml