#26 send emails with Action Mailer - Complete Guide

18/05/2021
  • Intro
  • Generate a new Mailer
  • Preview the mailer
  • Override default FROM address
  • Override TO, CC, BCC email address
  • Override email SUBJECT
  • Send email from controller
  • custom email params (current_user, post)
  • add sender name to default FROM address
  • Attach image
  • Display attached image inside email body
  • Update signature for all emails

In this episode we will use ActionMailer to send the User an email after he creates a Post. We will also explore different options and ways to customise our emails.

Action Mailer docs:
https://guides.rubyonrails.org/action_mailer_basics.html
Source Code for the Episode:
https://github.com/corsego/26-action-mailer/commit/6519734de30c87b39d90e726ebb602a23ff0fd40
My text notes for this episode: https://blog.corsego.com/action-mailer-basics

0:00 Intro
0:47 Generate a new Mailer
3:30 Preview the mailer
4:00 Override default FROM address
4:40 Override TO, CC, BCC email address
6:10 Override email SUBJECT
7:34 Send email from controller
9:20 custom email params (current_user, post)
11:34 add sender name to default FROM address
13:45 Attach image
15:15 Display attached image inside email body
16:12 Update signature for all emails

0
Join the conversation
Sign in to access PRO lessons, access private repos, leave comments, create watch lists.
We collect your email address, name and username to create your account. We do not share your email address with anyone else.