Created
June 5, 2018 17:55
-
-
Save rbnpercy/dbb5ee605699bbc7d79d61fb9648e9e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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