Skip to content

Instantly share code, notes, and snippets.

@rbnpercy
Created June 5, 2018 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbnpercy/dbb5ee605699bbc7d79d61fb9648e9e9 to your computer and use it in GitHub Desktop.
Save rbnpercy/dbb5ee605699bbc7d79d61fb9648e9e9 to your computer and use it in GitHub Desktop.
def send_email
mg_client = Mailgun::Client.new("YOUR-API-KEY")
message_params = {
from: 'robin@percy.pw',
to: IronWorker.payload['email'],
subject: 'Your daily developer articles!',
text: email_body()
}
result = mg_client.send_message('YOUR-SANDBOX-URL.mailgun.org', message_params).to_h!
message_id = result['id']
message = result['message']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment