Class: ApplicationMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- ApplicationMailer
- Includes:
- ElasticApmContext, Workers::Helpers
- Defined in:
- app/mailers/application_mailer.rb
Overview
typed: ignore
Direct Known Subclasses
AffiliatesDashboardMailer, OwnerMailer, Partner::StaffMailer, StaffMailer, TranslationExportMailer, UserMailer
Instance Method Summary collapse
Methods included from Workers::Helpers
Instance Method Details
#log_mailer(data) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/mailers/application_mailer.rb', line 18 def log_mailer(data) if data[:reservation_id] || data[:user_id] || data[:restaurant_id] BUSINESS_LOGGER.set_business_context({ reservation_id: data[:reservation_id], user_id: data[:user_id], restaurant_id: data[:restaurant_id], }) end = data[:subject] payload = data.except(:subject) if .blank? || payload.blank? raise ArgumentError, 'subject and payload are required' end BUSINESS_LOGGER.info(, payload) rescue StandardError => e APMErrorHandler.report e, data true end |
#switch_locale(&action) ⇒ Object
6 7 8 9 10 |
# File 'app/mailers/application_mailer.rb', line 6 def switch_locale(&action) I18n.with_locale(:en) do Globalize.with_locale(:en, &action) end end |