Research
- Action Mailer Basics Show archive.org snapshot
- Chapter "Task H: Sending Mail" from Agile Web Development with Rails 4 Show archive.org snapshot (in our library)
- HTML E-Mails mit MJML đź”’ Show archive.org snapshot
- E-mail deliverability
Exercises
- In MovieDB, if you did not implement sending a welcome e-mail, send an e-mail now.
- In MovieDB, whenever someone creates a movie, send a notification to
moviedb-admin@example.com
.- Can you attach a text file (any content) to the e-mail?
- Can you write a RSpec test for this?
- Hint: Action Mailer has a delivery method like
:smtp
or:sendmail
which can be different for each environment. For thetest
environment the delivery method is set to:test
, which means that new e-mails are stored as objects in theActionMailer::Base.deliveries
array. You can inspect this array in your tests.
- In the lesson Form Models we said that we don't like to send e-mails in core model callbacks. We would much rather send e-mails from form model callbacks. Why is that?
- Make sure that MovieDB does not send e-mails from your
Movie
model, but from a form model likeMovie::Form
.
- Make sure that MovieDB does not send e-mails from your
Discuss
With your mentor, discuss the challenges of implementing HTML mails well.
Posted by Henning Koch to makandra Curriculum (2015-07-08 17:49)