Sha256: 1e61b95dc866cf9bd9e584821a26131f84b9b6c988c9d221ec47845445514658

Contents?: true

Size: 864 Bytes

Versions: 14

Compression:

Stored size: 864 Bytes

Contents

class EcoRake
  module Lib
    module Notify
      class Mailer < EcoRake::Lib::BaseTask
        option '-t', '--to EMAIL', String, 'Destination recipient', required: true
        option '-s', '--subject SUBJECT', String, 'Subject of the email', required: true
        option '-m', '--body MESSAGE', String, 'The message of the email', required: true
        option '-c', '--cc EMAIL', String, 'CCing someone else'
        option '-b', '--bcc EMAIL', String, 'BCCing someone else'

        def task(*_args)
          kargs = {
            to:      options[:to],
            subject: options[:subject],
            body:    options[:body]
          }
          kargs.merge!(cc: options[:cc])   if options[:cc]
          kargs.merge!(bcc: options[:bcc]) if options[:bcc]
          mailer.mail(**kargs)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
eco-rake-0.2.7 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.6 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.5 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.4 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.3 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.2 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.1 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.2.0 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.1.6 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.1.5 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.1.4 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.1.3 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.1.2 lib/eco-rake/lib/notify/mailer.rb
eco-rake-0.1.1 lib/eco-rake/lib/notify/mailer.rb