From e4b1280952e0a5fb80b272dbb78e4e110cdb1819 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 2 Oct 2017 16:00:06 +0200 Subject: [PATCH] User clearer syntax for setting values when not already set --- app/mailers/mailer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 78709856..8936d308 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -76,11 +76,11 @@ class Mailer < ActionMailer::Base end def mail(args) - args[:message_id] = "#{Mail.random_tag}@#{default_url_options[:host]}" unless args[:message_id] + args[:message_id] ||= "#{Mail.random_tag}@#{default_url_options[:host]}" args[:subject] = "[#{FoodsoftConfig[:name]}] #{args[:subject]}" if args[:from].is_a? User - args[:reply_to] = args[:from] unless args[:reply_to] + args[:reply_to] ||= args[:from] args[:from] = "#{I18n.t('mailer.from_via_foodsoft', name: show_user(args[:from]))} <#{FoodsoftConfig[:email_sender]}>" end