Sha256: 3d02c91a098bcd1a3976df78e6a81f2c8ea57f42b5b16229396e776f934ddbcb

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

######################################################################
#                        EMAIL NOTIFIER TASKS                        #
######################################################################
require 'mail'

Capistrano::Configuration.instance(:must_exist).load do |cap|
  after     'deploy:cleanup',             'notify:by_email'

  namespace :notify do
    desc <<-DESC
      [internal] Sends a notification via email once a deployment is complete.
    DESC
    task :by_email do
      Mail.defaults do
        delivery_method cap[:email_notifier_mail_method], cap[:email_notifier_mail_options]
      end

      if !cap[:email_notifier_client_recipients].empty?
        Mail.deliver do
              to cap[:email_notifier_client_recipients]
            from cap[:email_notifier_sender]
         subject cap[:email_notifier_subject]
            body cap[:email_notifier_client_body]
        end
      end

      if !cap[:email_notifier_internal_recipients].empty?
        Mail.deliver do
              to cap[:email_notifier_internal_recipients]
            from cap[:email_notifier_sender]
         subject cap[:email_notifier_subject]
            body cap[:email_notifier_internal_body]
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chicken_soup-0.5.0 lib/chicken_soup/notifiers/email/email-tasks.rb
chicken_soup-0.4.1 lib/chicken_soup/notifiers/email/email-tasks.rb
chicken_soup-0.4.0 lib/chicken_soup/notifiers/email/email-tasks.rb
chicken_soup-0.3.0 lib/chicken_soup/notifiers/email/email-tasks.rb
chicken_soup-0.2.0 lib/chicken_soup/notifiers/email/email-tasks.rb