Using Mailrelay API with Ruby
If you’re using Ruby you can use our recently launched Mailrelay gem. Available for free at Rubygems as well as in our GitHub repository.
This gem will allow you to access our API functions in a simple way. To install it, run:
1 |
gem install mailrelay |
gem install mailrelay
After that, usage is pretty simple. If we want to add a subscriber to our Mailrelay account, for example, we could use the following script:
1 2 3 4 5 6 7 8 9 |
</p> <p>require 'rubygems'</p> <p>require 'mailrelay'</p> <p># Set your hostname and api key here</p> <p>hostname = 'your_hostname'</p> <p>api_key = 'your_api_key'</p> <p>api = Mailrelay::API.new hostname, api_key</p> <p>api.addSubscriber :email => "email@example.org", :name => "Name"</p> <p> |
</p> <p>require 'rubygems'</p> <p>require 'mailrelay'</p> <p># Set your hostname and api key here</p> <p>hostname = 'your_hostname'</p> <p>api_key = 'your_api_key'</p> <p>api = Mailrelay::API.new hostname, api_key</p> <p>api.addSubscriber :email => "email@example.org", :name => "Name"</p> <p>
There are other examples available in GitHub and you can always check our API documentation for more info. All functions available in API can be used with our gem.
We hope this is useful for all Ruby developers whom would like to manage your Mailrelay accounts using the API.

USA Office: + 1 212 3819667 
Spain, Madrid: +34 91 1881675
Mexico, Mexico: +52 5511689610
Peru, Lima: +51 17086744
Argentina, Buenos Aires: +54 1152391324
Chile, Santiago: +56 25708751
Colombia, Bogota: +57 13819046
Comments