Make Devise::Mailer inherit from ApplicationMailer

This way we remove duplication in the `from:` proc, the helpers, and the
methods we're about to write.
This commit is contained in:
Javi Martín
2022-09-24 15:37:35 +02:00
parent e5933ce6bb
commit a729967e8a
3 changed files with 6 additions and 3 deletions

View File

@@ -14,11 +14,15 @@ 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 = proc { "'#{Setting["mailer_from_name"]}' <#{Setting["mailer_from_address"]}>" }
# We're not setting it here because it's set by the ApplicationMailer class
# config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
# Configure the class responsible to send e-mails.
config.mailer = "DeviseMailer"
# Configure the parent class responsible to send e-mails.
config.parent_mailer = "ApplicationMailer"
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be