Skip to content

Instantly share code, notes, and snippets.

@kernelsmith
Created April 5, 2015 19:23
Show Gist options
  • Select an option

  • Save kernelsmith/b241342171af7bd1a9da to your computer and use it in GitHub Desktop.

Select an option

Save kernelsmith/b241342171af7bd1a9da to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment