Files
leadchat/config
netlas a00bcb204e fix(mailer): apply delivery_method directly to ActionMailer::Base
The ActionMailer railtie's on_load hook applies config.action_mailer.*
settings to ActionMailer::Base when ActionMailer::Base is first
referenced. In our initializer load order, devise.rb runs before
mailer.rb (alphabetical) and triggers ActionMailer::Base loading via
Devise::Mailer. By the time mailer.rb runs, the on_load hook has
already fired with the default :smtp delivery method, and subsequent
writes to config.action_mailer.delivery_method are silently ignored.

Result: production transactional emails (Devise confirmation, password
reset, member invitations) were being sent via Mail's default :smtp
delivery method to localhost:25, raising Errno::ECONNREFUSED on every
attempt — silently in deliver_later. LeadMail was never actually used
despite LEADMAIL_API_TOKEN being set.

Fix is to set ActionMailer::Base.delivery_method (and the matching
*_settings) directly in addition to config.action_mailer.*. Same pattern
applied to the SMTP and sendmail fallback branches for consistency.

Verified locally: rails runner now reports delivery_method=:leadmail
when LEADMAIL_API_TOKEN is set.
2026-04-27 19:55:11 +03:00
..
2026-04-16 19:02:23 +05:30
2019-08-19 13:49:57 +05:30
2019-08-14 15:18:44 +05:30
2022-07-12 12:27:33 +02:00
2019-08-15 23:08:36 +05:30
2019-10-20 14:17:26 +05:30
2024-10-02 00:36:30 -07:00