Sha256: 9d184df26b77b0d8fa352e3556f1d93c2fe7a760c5b4ce49b2c8739df0df28ab

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

module Mailstro
  class Delivery < Resource
    def self.deliver(template_name, contact_email, payload)
      new(template_name, contact_email, payload).deliver
    end

    attr_reader :contact_email, :template_name

    def initialize(template_name, contact_email, payload)
      @template_name = template_name
      @contact_email = contact_email
      @payload       = payload
    end

    def deliver
      post("deliveries", :template_name => @template_name,
                         :contact_email => @contact_email,
                         :payload       => @payload)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mailstro-0.0.5 lib/mailstro/delivery.rb
mailstro-0.0.4 lib/mailstro/delivery.rb