lib/mailstro.rb in mailstro-0.0.4 vs lib/mailstro.rb in mailstro-0.0.5
- old
+ new
@@ -1,22 +1,36 @@
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, contact_email, payload = {})
- Delivery.deliver(template, contact_email, payload)
+ 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