Sha256: 4c2635714c9eee764c6884448c825c4e8533200cdf280479dfd0f083509822a9

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

require_relative "mailstro/version"
require_relative "mailstro/configuration"
require_relative "mailstro/resource"
require_relative "mailstro/error"
require_relative "mailstro/delivery"
require_relative "mailstro/list_delivery"
require_relative "mailstro/list_subscribe"
require_relative "mailstro/list_unsubscribe"

module Mailstro
  class << self
    attr_accessor :configuration
  end

  def self.configure
    self.configuration ||= Configuration.new
    yield(configuration)
    configuration.validate!
  end

  def self.deliver(template_name, contact_email, payload = {})
    Delivery.deliver(template_name, contact_email, payload)
  end

  def self.list_deliver(template_name, list, payload = {})
    ListDelivery.deliver(template_name, list, payload)
  end

  def self.list_subscribe(list_name, contact_email)
    ListSubscribe.subscribe(list_name, contact_email)
  end

  def self.list_unsubscribe(list_name, contact_email)
    ListUnsubscribe.unsubscribe(list_name, contact_email)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mailstro-0.0.5 lib/mailstro.rb