Sha256: 3c6d665e8f91339a498a14305e05fb8d5fecc5561a11a50b880474d6c248ea66

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

module Mailstro
  class ListDelivery < Resource
    def initialize(options)
      @options = options
    end

    def list_type
      @options.fetch(:to)[0]
    end

    def list_name
      @options.fetch(:to)[1]
    end

    def template_name
      @options.fetch(:template_name)
    end

    def template_data
      @options.fetch(:template_data, nil)
    end

    def deliver
      post("lists/deliveries",
           :list_type     => list_type,
           :list_name     => list_name,
           :template_name => template_name,
           :template_data => template_data
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mailstro-0.0.8 lib/mailstro/list_delivery.rb
mailstro-0.0.7 lib/mailstro/list_delivery.rb