Skip to content

holinnn/mailjetter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Access Mailjet API from ruby with mailjetter

Add mailjetter in your Gemfile

gem 'mailjetter', :git => 'git://github.com/holinnn/mailjetter.git'
Mailjetter.configure do |config|
  config.use_https = true
  config.api_key = 'Your api key'
  config.secret_key = 'Your secret key'
end
api = Mailjetter::Api.new
api.user_infos
=> {"infos"=>{"username"=>"", "firstname"=>"", "lastname"=>"", "company_name"=>"", "locale"=>"fr_FR", "contact_phone"=>nil}}
api.lists_contacts(:id => 639)
=> {"status"=>"OK", "total_cnt"=>"1", "result"=>[{"id"=>"8225160", "last_activity"=>"0", "sent"=>"0", "email"=>"user@host.com"}]}

Or (if not configured)

api = Mailjetter::Api.new('Your api key', 'Your secret key')
api.user_infos
=> {"infos"=>{"username"=>"", "firstname"=>"", "lastname"=>"", "company_name"=>"", "locale"=>"fr_FR", "contact_phone"=>nil}}

It tries to guess the HTTP method to use based on the name of the method you call, if you want to force the request type just add it after the parameters :

api.lists_contacts({:id => 639}, 'Get')

Copyright © 2011 Holinnn. See LICENSE.txt for further details.

About

A Mailjet ruby library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages