From f94678627c97c74b23cfbe497791d2715235d837 Mon Sep 17 00:00:00 2001 From: John Ma Date: Thu, 8 Nov 2018 10:27:26 -0500 Subject: [PATCH] Allow for specification of email sender (#311) * * * --- app/mailers/user_mailer.rb | 4 ++-- app/views/user_mailer/verify_email.html.erb | 4 ++-- app/views/user_mailer/verify_email.text.erb | 2 +- sample.env | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index ecab8127..31f230c6 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -17,11 +17,11 @@ # with BigBlueButton; if not, see . class UserMailer < ApplicationMailer - default from: 'notifications@example.com' + default from: Rails.configuration.email_sender def verify_email(user, url) @user = user @url = url - mail(to: @user.email, subject: 'Welcome to BigBlueButton!') + mail(to: @user.email, subject: t('landing.welcome')) end end diff --git a/app/views/user_mailer/verify_email.html.erb b/app/views/user_mailer/verify_email.html.erb index 7cda6e2e..ef941681 100644 --- a/app/views/user_mailer/verify_email.html.erb +++ b/app/views/user_mailer/verify_email.html.erb @@ -22,9 +22,9 @@ -

Welcome to Greenlight!, <%= @user.name %>

+

Welcome to BigBlueButton!, <%= @user.name %>

- You have successfully signed up for Greenlight, + You have successfully registered your Greenlight account, your username is: <%= @user.email %>.

diff --git a/app/views/user_mailer/verify_email.text.erb b/app/views/user_mailer/verify_email.text.erb index 9448e553..b73122f6 100644 --- a/app/views/user_mailer/verify_email.text.erb +++ b/app/views/user_mailer/verify_email.text.erb @@ -20,7 +20,7 @@ Welcome to Greenlight, <%= @user.name %> =============================================== -You have successfully signed up for Greenlight, +You have successfully registered your Greenlight account, your username is: <%= @user.email %>. To verify your account, just follow this link: <%= link_to 'verify your email', @url %>. diff --git a/sample.env b/sample.env index 8125d3c1..e9ca6edd 100644 --- a/sample.env +++ b/sample.env @@ -94,6 +94,9 @@ SMTP_PASSWORD= SMTP_AUTH= SMTP_STARTTLS_AUTO= +# Specify the email address that all mail is sent from +EMAIL_SENDER= + # Prefix for the applications root URL. # Useful for deploying the application to a subdirectory, which is highly recommended # if deploying on a BigBlueButton server. Keep in mind that if you change this, you'll