Posted about 4 years ago. Visible to the public.

Rails: Sending e-mail [2d]

Research

Exercises

  • 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 Cucumber feature for this?
    • Hint: Action Mailer has a delivery method like :smtp or :sendmail which can be different for each environment. For the test environment the delivery method is set to :test, which means that new e-mails are stored as objects in the ActionMailer::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 like Movie::AsForm.

Owner of this card:

Avatar
Henning Koch
Last edit:
19 days ago
by Hannes Randow
Posted by Henning Koch to makandra Curriculum
This website uses cookies to improve usability and analyze traffic.
Accept or learn more