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 # The email from which all outgoing emails are sent
# could user either `email@yourdomain.com` or `BrandName <email@yourdomain.com>` # 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 #SMTP domain key is set up for HELO checking

View file

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

View file

@ -1,7 +1,8 @@
class ApplicationMailer < ActionMailer::Base class ApplicationMailer < ActionMailer::Base
include ActionView::Helpers::SanitizeHelper 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)) } before_action { ensure_current_account(params.try(:[], :account)) }
around_action :switch_locale around_action :switch_locale
layout 'mailer/base' layout 'mailer/base'

View file

@ -1,5 +1,5 @@
class ConversationReplyMailer < ApplicationMailer 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 layout :choose_layout
def reply_with_summary(conversation, message_queued_time) def reply_with_summary(conversation, message_queued_time)

View file

@ -100,7 +100,7 @@ class Account < ApplicationRecord
end end
def support_email 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 end
private private

View file

@ -12,7 +12,7 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer, # 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 # note that it will be overwritten if you use your own mailer class
# with default "from" parameter. # 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. # Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer' # config.mailer = 'Devise::Mailer'