I'm on Rails 4 and I've got one mailer. This was created following the tutorial in the docs.
class UserMailer < ActionMailer::Base
@delivery_options = {
user_name: 'user_name',
password: 'password',
address: 'smtp.sendgrid.net'
}
default from: "Auto <auto@mysite.me>"
def welcome_email (user, password)
@user = user
@password = password
@url = "http://url.com"
mail(to: @user.email, subject: "Welcome to my site", delivery_method_options: @delivery_options)
end
def project_invite_email (email, project)
@project = project
mail(to: email, subject: "#{@project.user.first_name} #{@project.user.last_name} requests a video from you", delivery_method_options: @delivery_options)
end
end
During the course of troubleshooting some deliverability issues, I found that some emails included different headers than others. It turned out that a combination of SPF, DKIM, and adjustments to the email copy were able to resolve the deliverability problems (many were previously caught by spam filters), but I'd still like to know more about how Rails is creating the headers for these emails.
For example, the second one includes this in the header: Content-Transfer-Encoding: 7bit
but the first has this: Content-Transfer-Encoding: quoted-printable
As you can see, they both use the exact same configurations. The only difference is the content of the views (both have an HTML & text version).
Is rails adjusting the headers based on content?