lib/mailstro/delivery.rb in mailstro-0.0.9 vs lib/mailstro/delivery.rb in mailstro-0.0.10
- old
+ new
@@ -1,27 +1,26 @@
module Mailstro
class Delivery < Resource
- def initialize(options)
- @options = options
+ attr_reader :email_name
+
+ def initialize(email_name, options)
+ @email_name = email_name
+ @options = options
end
- def contact_email
+ def to
@options.fetch(:to)
end
- def template_name
- @options.fetch(:template_name)
+ def data
+ @options.fetch(:data, nil)
end
- def template_data
- @options.fetch(:template_data, nil)
- end
-
def deliver
post("deliveries",
- :contact_email => contact_email,
- :template_name => template_name,
- :template_data => template_data
+ :to => to,
+ :email_name => email_name,
+ :data => data
)
end
end
end