Module: EcoRake::Utils::Mailing
- Defined in:
- lib/eco-rake/utils/mailing.rb
Instance Method Summary collapse
- #email(subject:, body:, to:, enviro: nil) ⇒ Object
-
#email_missing_files(enviro:, to:) ⇒ Object
Helper to notify that there are no files to be processed.
- #mailer ⇒ EcoRake::Mailer
Instance Method Details
#email(subject:, body:, to:, enviro: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/eco-rake/utils/mailing.rb', line 9 def email(subject:, body:, to:, enviro: nil) has_enviro = enviro && subject&.downcase&.include?(enviro.downcase) subject = "#{enviro.upcase} - #{subject}" if enviro && !has_enviro mailer.mail( to: to, subject: subject, body: body ) end |
#email_missing_files(enviro:, to:) ⇒ Object
Helper to notify that there are no files to be processed
20 21 22 23 24 25 26 |
# File 'lib/eco-rake/utils/mailing.rb', line 20 def email_missing_files(enviro:, to:) email( to: to, subject: "#{enviro.upcase} (No files to be processed)", body: 'No files found to be processed. Aborting...' ) end |