Last active
April 10, 2018 23:24
-
-
Save guihatano/7f5dff665cfce53fd0b0a8c915d0d791 to your computer and use it in GitHub Desktop.
Rails using RestClient to call mailgun with attachment. When I was searching I just found same ways using RestClient::Request.execute, so I'm sharing this other way
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
require 'json' | |
result = RestClient.post "https://api:[email protected]/v2/domain.com/", | |
:from => "YourDomain <[email protected]>", | |
:to => "[email protected]", | |
:subject => "Mailgun with attachment", | |
:text => "Hello, Put something here", | |
:multipart => true, | |
:attachment => File.new('path/to/file', 'rb') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment