I am using Rails 4 to make a web app.
I have a mailer set up to send a welcome mailer to new users.
I want to change the appearance of the sender name from the email address to "Welcome to CF".
Where to I set the name of the sender?
class WelcomeMail < ActionMailer::Base
self.delivery_method = :smtp
self.smtp_settings = {
user_name: ENV['GPROD_WELCOME'],
password: ENV['GPwPROD_WELCOME'],
port: 587,
domain: 'cr.com',
address: 'smtp.gmail.com',
authentication: 'plain',
enable_starttls_auto: true
}
def welcome_mail(user)
@user = user
mail(to: user.email, from: "[email protected]", subject: "Welcome to Cr, #{user.first_name}")
end
end
When it's changed, I want [email protected] to appear as Welcome to CR.
Change the value of from within your mail params:
from: "Angus <[email protected]>"
The text before the <> will be displayed as the from name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With