Add configuration
This commit is contained in:
parent
7e9b31a406
commit
07239b26ce
|
@ -3,5 +3,5 @@
|
||||||
class ApplicationMailer < ActionMailer::Base
|
class ApplicationMailer < ActionMailer::Base
|
||||||
layout 'mailer'
|
layout 'mailer'
|
||||||
|
|
||||||
default from: Devise.mailer_sender
|
default from: Rails.application.config.noreply_email_address
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,6 +35,7 @@ module Partynest
|
||||||
|
|
||||||
# Fully qualified domain name.
|
# Fully qualified domain name.
|
||||||
config.site_domain = 'libertarian-party.com'
|
config.site_domain = 'libertarian-party.com'
|
||||||
|
config.noreply_email_address = "no-reply@#{config.site_domain}"
|
||||||
|
|
||||||
# ActionMailer previews
|
# ActionMailer previews
|
||||||
config.action_mailer.preview_path = Rails.root.join('app', 'previews')
|
config.action_mailer.preview_path = Rails.root.join('app', 'previews')
|
||||||
|
|
|
@ -20,7 +20,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 = "no-reply@#{Rails.application.config.site_domain}"
|
config.mailer_sender = Rails.application.config.noreply_email_address
|
||||||
|
|
||||||
# Configure the class responsible to send e-mails.
|
# Configure the class responsible to send e-mails.
|
||||||
# config.mailer = 'Devise::Mailer'
|
# config.mailer = 'Devise::Mailer'
|
||||||
|
|
|
@ -56,6 +56,7 @@ RSpec.describe 'POST /membership_applications' do
|
||||||
|
|
||||||
specify do
|
specify do
|
||||||
expect(ActionMailer::Base.deliveries.last).to have_attributes(
|
expect(ActionMailer::Base.deliveries.last).to have_attributes(
|
||||||
|
from: [Rails.application.config.noreply_email_address],
|
||||||
to: [MembershipApplication.last.email],
|
to: [MembershipApplication.last.email],
|
||||||
subject: I18n.t('membership_application_mailer.tracking.subject'),
|
subject: I18n.t('membership_application_mailer.tracking.subject'),
|
||||||
)
|
)
|
||||||
|
|
Reference in New Issue