From 524dd6cd0699635e043616d6b31e2760cb689524 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 6 Jul 2025 19:37:33 +0200 Subject: [PATCH] Update FROM address for email delivery --- app/mailers/application_mailer.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index b28db31..ea56be3 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -3,6 +3,16 @@ # frozen_string_literal: true class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' + default from: default_from layout 'mailer' + + class << self + private + + def default_from + File.read('/run/secrets/smtp_user_name').strip + rescue Errno::ENOENT + 'development@example.com' + end + end end