Complete the code to define a mailer class inheriting from the correct base class.
class UserMailer < [1] end
The mailer class must inherit from ActionMailer::Base to use Action Mailer's features.
Complete the method to send a welcome email with the correct mail method call.
def welcome_email(user) @user = user mail(to: @user.email, subject: [1]) end
The mail method's subject option expects a string for the email subject line.
Fix the error in setting the default 'from' email address in the mailer class.
class UserMailer < ActionMailer::Base default [1]: 'no-reply@example.com' end
The correct key to set the sender email address is from in the default method.
Fill both blanks to configure SMTP settings in the environment file.
config.action_mailer.delivery_method = [1] config.action_mailer.smtp_settings = [2]
Set delivery method to :smtp and provide SMTP server details in smtp_settings.
Fill all three blanks to create a mailer method that sets instance variable, calls mail, and specifies a template.
def notification_email(user) [1] = user mail(to: user.email, subject: 'Notification') do |format| format.[2] [3] end end
Set @user instance variable, use html format, and specify the template symbol :notification_email.