Complete the code to send an email using Action Mailer in Rails.
UserMailer.[1](user).deliver_nowThe method welcome_email is the standard naming for sending a welcome email in Rails mailers.
Complete the code to define the email subject in a mailer method.
mail(to: user.email, subject: [1])The subject must be a string, so it needs quotes like 'Hello User'.
Fix the error in the mailer method to properly set the recipient email.
mail(to: [1].email, subject: 'Welcome!')
The variable user holds the user object with the email attribute.
Fill both blanks to create a mailer method that sends a password reset email.
def [1](user) @user = user mail(to: @user.email, subject: [2]) end
The method name password_reset is conventional, and the subject should be a string describing the email.
Fill all three blanks to create a mailer method that sends a notification with a dynamic subject.
def [1](user, notification) @user = user @notification = notification mail(to: @user.email, subject: [2] + ' - ' + [3]) end
The method notify_user sends notifications. The subject combines a static string and the notification's title.