mirror of https://github.com/mastodon/mastodon
Add optional bulk mailer settings (#35203)
parent
bae258925c
commit
c357a7f8d6
@ -0,0 +1,18 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module BulkMailSettingsConcern
|
||||||
|
include ActiveSupport::Concern
|
||||||
|
include Mastodon::EmailConfigurationHelper
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def use_bulk_mail_delivery_settings
|
||||||
|
return if bulk_mail_configuration&.dig(:smtp_settings, :address).blank?
|
||||||
|
|
||||||
|
mail.delivery_method.settings = convert_smtp_settings(bulk_mail_configuration[:smtp_settings])
|
||||||
|
end
|
||||||
|
|
||||||
|
def bulk_mail_configuration
|
||||||
|
Rails.configuration.x.email&.bulk_mail
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module BulkMailer
|
module BulkMailingConcern
|
||||||
def push_bulk_mailer(mailer_class, mailer_method, args_array)
|
def push_bulk_mailer(mailer_class, mailer_method, args_array)
|
||||||
raise ArgumentError, "No method #{mailer_method} on class #{mailer_class.name}" unless mailer_class.respond_to?(mailer_method)
|
raise ArgumentError, "No method #{mailer_method} on class #{mailer_class.name}" unless mailer_class.respond_to?(mailer_method)
|
||||||
|
|
||||||
Loading…
Reference in New Issue