Merge pull request #1303 from ferblape/extract-mailer-from-to-setting
Extract mailer from name and address to a setting
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class ApplicationMailer < ActionMailer::Base
|
class ApplicationMailer < ActionMailer::Base
|
||||||
helper :settings
|
helper :settings
|
||||||
default from: "Consul <no-reply@consul.es>"
|
default from: "#{Setting['mailer_from_name']} <#{Setting['mailer_from_address']}>"
|
||||||
layout 'mailer'
|
layout 'mailer'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ 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 = 'noreply@consul.es'
|
if Rails.env.test?
|
||||||
|
config.mailer_sender = "noreply@example.org"
|
||||||
|
else
|
||||||
|
config.mailer_sender = "#{Setting['mailer_from_name']} <#{Setting['mailer_from_address']}>"
|
||||||
|
end
|
||||||
|
|
||||||
# Configure the class responsible to send e-mails.
|
# Configure the class responsible to send e-mails.
|
||||||
config.mailer = 'DeviseMailer'
|
config.mailer = 'DeviseMailer'
|
||||||
|
|||||||
@@ -30,3 +30,5 @@ en:
|
|||||||
spending_proposals: Investment projects
|
spending_proposals: Investment projects
|
||||||
spending_proposal_features:
|
spending_proposal_features:
|
||||||
voting_allowed: Voting on investment projects
|
voting_allowed: Voting on investment projects
|
||||||
|
mailer_from_name: Origin email name
|
||||||
|
mailer_from_address: Origin email address
|
||||||
|
|||||||
@@ -30,3 +30,5 @@ es:
|
|||||||
spending_proposals: Propuestas de inversión
|
spending_proposals: Propuestas de inversión
|
||||||
spending_proposal_features:
|
spending_proposal_features:
|
||||||
voting_allowed: Votaciones sobre propuestas de inversión.
|
voting_allowed: Votaciones sobre propuestas de inversión.
|
||||||
|
mailer_from_name: Nombre email remitente
|
||||||
|
mailer_from_address: Dirección email remitente
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ Setting.create(key: 'feature.facebook_login', value: "true")
|
|||||||
Setting.create(key: 'feature.google_login', value: "true")
|
Setting.create(key: 'feature.google_login', value: "true")
|
||||||
Setting.create(key: 'per_page_code', value: "")
|
Setting.create(key: 'per_page_code', value: "")
|
||||||
Setting.create(key: 'comments_body_max_length', value: '1000')
|
Setting.create(key: 'comments_body_max_length', value: '1000')
|
||||||
|
Setting.create(key: 'mailer_from_name', value: 'Consul')
|
||||||
|
Setting.create(key: 'mailer_from_address', value: 'noreply@consul.dev')
|
||||||
|
|
||||||
puts "Creating Geozones"
|
puts "Creating Geozones"
|
||||||
('A'..'Z').each { |i| Geozone.create(name: "District #{i}", external_code: i.ord, census_code: i.ord) }
|
('A'..'Z').each { |i| Geozone.create(name: "District #{i}", external_code: i.ord, census_code: i.ord) }
|
||||||
|
|||||||
@@ -81,3 +81,7 @@ Setting['banner-img.banner-img-three'] = "Banner image 3"
|
|||||||
# Proposal notifications
|
# Proposal notifications
|
||||||
Setting['proposal_notification_minimum_interval_in_days'] = 3
|
Setting['proposal_notification_minimum_interval_in_days'] = 3
|
||||||
Setting['direct_message_max_per_day'] = 3
|
Setting['direct_message_max_per_day'] = 3
|
||||||
|
|
||||||
|
# Email settings
|
||||||
|
Setting['mailer_from_name'] = 'Consul'
|
||||||
|
Setting['mailer_from_address'] = 'noreply@consul.dev'
|
||||||
|
|||||||
Reference in New Issue
Block a user