lib/eco-rake/utils/mailing.rb in eco-rake-0.2.6 vs lib/eco-rake/utils/mailing.rb in eco-rake-0.2.7

- old
+ new

@@ -5,25 +5,25 @@ def mailer @mailer ||= EcoRake::Utils::Mailer.new end def email(subject:, body:, to:, enviro: nil) - has_enviro = enviro && subject && subject.downcase.include?(enviro.downcase) + has_enviro = enviro && subject&.downcase&.include?(enviro.downcase) subject = "#{enviro.upcase} - #{subject}" if enviro && !has_enviro - mailer.mail(**{ + mailer.mail( to: to, subject: subject, body: body - }) + ) end # Helper to notify that there are no files to be processed def email_missing_files(enviro:, to:) - email(**{ + email( to: to, subject: "#{enviro.upcase} (No files to be processed)", body: 'No files found to be processed. Aborting...' - }) + ) end end end end