I have my application setup so that e-mail templates are stored in the
database, and each time an e-mail is sent out, a new entry is entered
into the database with the email_template_id, what e-mail-specific
variables must be included in the template (ex. a user's first name, a
product URL, etc.) that change with each e-mail. A process then runs
in the background and takes these e-mails, replaces the e-mail-
specific variables into the template, and mails it out.
When the e-mail-specific variables are put in the database, they first
get converted into YAML, so if a user's name was Brontë, it becomes
Bront\xC3\xAB in the YAML format.
When the variables (such as the first name) get loaded by the process
back into the e-mail from the database YAML, in IRB I see that the
body text of the e-mail has the name correctly converted back to
=> "Hi Brontë (rest of email)
However, when this e-mail gets passed to ActionMailer and delivered,
the e-mail appears as:
The charset attribute on the e-mails is UTF-8 (the ActionMailer
default) which isn't overridden when the mail is sent.