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