chore: Rename MAILER_SENDER_EMAIL to FROM_EMAIL_ADDRESS

This commit is contained in:
Pranav Raj S 2021-08-06 08:02:17 +05:30
parent f934a5eb04
commit 3cacaf6d92
6 changed files with 20 additions and 24 deletions

View file

@ -41,7 +41,7 @@ RAILS_MAX_THREADS=5
# The email from which all outgoing emails are sent
# could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>`
MAILER_SENDER_EMAIL=Chatwoot <accounts@chatwoot.com>
FROM_EMAIL_ADDRESS=Chatwoot <accounts@chatwoot.com>
#SMTP domain key is set up for HELO checking

View file

@ -83,7 +83,7 @@ GEM
ast (2.4.2)
attr_extras (6.2.4)
aws-eventstream (1.1.1)
aws-partitions (1.482.0)
aws-partitions (1.483.0)
aws-sdk-core (3.119.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
@ -115,7 +115,7 @@ GEM
statsd-ruby (~> 1.1)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.7.6)
bootsnap (1.7.7)
msgpack (~> 1.0)
brakeman (5.1.1)
browser (5.3.1)
@ -138,7 +138,7 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
cypress-on-rails (1.10.1)
cypress-on-rails (1.11.0)
rack
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
@ -214,7 +214,7 @@ GEM
grpc (~> 1.25)
geocoder (1.6.7)
gli (2.20.1)
globalid (0.5.1)
globalid (0.5.2)
activesupport (>= 5.0)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
@ -249,8 +249,7 @@ GEM
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
google-protobuf (3.17.3-universal-darwin)
google-protobuf (3.17.3-x86_64-linux)
google-protobuf (3.17.3)
googleapis-common-protos (1.3.11)
google-protobuf (~> 3.14)
googleapis-common-protos-types (>= 1.0.6, < 2.0)
@ -266,10 +265,7 @@ GEM
signet (~> 0.14)
groupdate (5.2.2)
activesupport (>= 5)
grpc (1.38.0-universal-darwin)
google-protobuf (~> 3.15)
googleapis-common-protos-types (~> 1.0)
grpc (1.38.0-x86_64-linux)
grpc (1.38.0)
google-protobuf (~> 3.15)
googleapis-common-protos-types (~> 1.0)
haikunator (1.1.1)
@ -348,6 +344,7 @@ GEM
mime-types-data (3.2021.0704)
mini_magick (4.11.0)
mini_mime (1.1.0)
mini_portile2 (2.5.3)
minitest (5.14.4)
mock_redis (0.28.0)
ruby2_keywords
@ -360,10 +357,9 @@ GEM
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
netrc (0.11.0)
nio4r (2.5.7)
nokogiri (1.11.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.11.7-x86_64-linux)
nio4r (2.5.8)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
oauth (0.5.6)
orm_adapter (0.5.0)
@ -490,7 +486,7 @@ GEM
ruby2ruby (2.4.4)
ruby_parser (~> 3.1)
sexp_processor (~> 4.6)
ruby_parser (3.16.0)
ruby_parser (3.17.0)
sexp_processor (~> 4.15, >= 4.15.1)
sassc (2.4.0)
ffi (~> 1.9)
@ -604,8 +600,8 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.13.0)
addressable (>= 2.3.6)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.0)
@ -624,8 +620,7 @@ GEM
zeitwerk (2.4.2)
PLATFORMS
x86_64-darwin-21
x86_64-linux
ruby
DEPENDENCIES
active_record_query_trace

View file

@ -1,7 +1,8 @@
class ApplicationMailer < ActionMailer::Base
include ActionView::Helpers::SanitizeHelper
default from: ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
### Todo: Remove MAILER_SENDER_EMAIL after 4 releases
default from: ENV.fetch('FROM_EMAIL_ADDRESS') || ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
before_action { ensure_current_account(params.try(:[], :account)) }
around_action :switch_locale
layout 'mailer/base'

View file

@ -1,5 +1,5 @@
class ConversationReplyMailer < ApplicationMailer
default from: ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
default from: ENV.fetch('FROM_EMAIL_ADDRESS') || ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
layout :choose_layout
def reply_with_summary(conversation, message_queued_time)

View file

@ -100,7 +100,7 @@ class Account < ApplicationRecord
end
def support_email
super || GlobalConfig.get('MAILER_SUPPORT_EMAIL')['MAILER_SUPPORT_EMAIL'] || ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
super || GlobalConfig.get('MAILER_SUPPORT_EMAIL')['MAILER_SUPPORT_EMAIL'] || ENV.fetch('FROM_EMAIL_ADDRESS') || ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
end
private

View file

@ -12,7 +12,7 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
config.mailer_sender = ENV.fetch('FROM_EMAIL_ADDRESS') || ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')
# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'