lib/eco-rake/utils/mailing.rb in eco-rake-0.1.3 vs lib/eco-rake/utils/mailing.rb in eco-rake-0.1.4

- old
+ new

@@ -5,11 +5,11 @@ def mailer @mailer ||= EcoRake::Utils::Mailer.new end def email(subject:, body:, to:, enviro: nil) - has_enviro = subject && subject.downcase.include?(enviro.downcase) - subject = "#{enviro.upcase} - #{subject}" unless !enviro && has_enviro + has_enviro = enviro && subject && subject.downcase.include?(enviro.downcase) + subject = "#{enviro.upcase} - #{subject}" if enviro && !has_enviro mailer.mail(**{ to: to, subject: subject, body: body })