kernelsmith
4/5/2015 - 7:23 PM

Mailgun

Mailgun

require 'mailgun'

# First, instantiate the Mailgun Client with your API key
mailgun = Mailgun::Client.new "your-api-key"

# Define your message parameters
message_params = {:from    => 'me@sending_domain.com',  
                  :to      => 'you@example.com',
                  :subject => 'The Ruby SDK is awesome!',
                  :text    => 'It is really easy to send a message!'}

# Send your message through the client
mailgun.send_message "sending_domain.com", message_params

# you can use a batch message and template to send form emails