Created
November 15, 2016 15:36
-
-
Save luctus/a5f09f0e6bc7612d699f44f36bc957eb to your computer and use it in GitHub Desktop.
Here you can see how to set parameters for the great Sendgrid's SMTP API (Take a look to lines 15-19) with Ruby on Rails
This file contains hidden or 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
class ReportMailer < ApplicationMailer | |
def daily_email(report) | |
@report = report | |
@user = report.user | |
headers["X-SMTPAPI"] = { | |
category: report.category, | |
unique_args: { report: report.id, user: report.user.id } | |
}.to_json | |
mail( | |
to: report.recipients, | |
subject: report.name, | |
from: 'Dailytics.com <[email protected]>' | |
) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment