app/views/user_mailer/new_account_email.html.erb
with
the following content:<!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> </head> <body> <p>Hello <%= @user.name %>,</p> <p>your new account is active.</p> <p><i>Have a great day!</i></p> <p>A Robot</p> </body> </html>
log/development.log
will show you what was rendered
and the e-mail that was sent:Rendered notification/new_account.html.erb (2.0ms) Rendered notification/new_account.text.erb (0.4ms) Sent mail to stefan.wintermeyer@amooma.de (69ms) Date: Wed, 30 May 2012 17:46:49 +0200 From: from@example.com To: stefan.wintermeyer@amooma.de Message-ID: <4fc640e930bff_aa173fd61d828ce0501e4@MacBook.local.mail> Subject: The new account Wintermeyer is active. Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_4fc640e921794_aa173fd61d828ce04987d"; charset=UTF-8 Content-Transfer-Encoding: 7bit ----==_mimepart_4fc640e921794_aa173fd61d828ce04987d Date: Wed, 30 May 2012 17:46:49 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <4fc640e926312_aa173fd61d828ce04998e@MacBook.local.mail> Hello Wintermeyer, your new account is active. Have a great day! A Robot ----==_mimepart_4fc640e921794_aa173fd61d828ce04987d Date: Wed, 30 May 2012 17:46:49 +0200 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <4fc640e928055_aa173fd61d828ce0500ea@MacBook.local.mail> <!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> </head> <body> <p>Hello Wintermeyer,</p> <p>your new account is active.</p> <p><i>Have a great day!</i></p> <p>A Robot</p> </body> </html> ----==_mimepart_4fc640e921794_aa173fd61d828ce04987d--
multipart/alternative
, as the view was present both in
the format html.erb
and
text.erb
.Updates about this book will be published on my Twitter feed.