Sha256: 49a68fa5bda692f9dce4572c6a28ef28939e02617563ae0f3103f78fd4052751

Contents?: true

Size: 655 Bytes

Versions: 2

Compression:

Stored size: 655 Bytes

Contents

module Messaging
  module Email
    class Send < RestPack::Service::Command
      required do
        integer :application_id
        string :to
        string :template
      end

      optional do
        string :from #TODO: GJ: add email validation
        string :subject
        string :cc
        string :bcc
        string :reply_to
        hash :data
      end

      def execute
        inputs[:data] = raw_inputs[:data] if raw_inputs[:data]
        job_id = Rubykiq.push(
          class: 'Jobs::Email::Send',
          queue: 'email',
          args: [inputs]
        )

        {
          job_id: job_id
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restpack_service_messaging-0.0.4 lib/restpack_service_messaging/commands/email/send.rb
restpack_service_messaging-0.0.3 lib/restpack_service_messaging/commands/email/send.rb