class Tr8n::Api::PostOffice
Constants
- POST_OFFICE_API_VERSION
- POST_OFFICE_HOST
Public Instance Methods
channels()
click to toggle source
# File lib/tr8n/api/post_office.rb, line 45 def channels api('channels', { :access_token => access_token }) end
deliver(template, to, tokens = {}, options = {})
click to toggle source
# File lib/tr8n/api/post_office.rb, line 51 def deliver(template, to, tokens = {}, options = {}) api("templates/#{template}/deliver", { :access_token => access_token, :tokens => tokens, :to => to, :via => options[:via], :from => options[:from], :locale => options[:locale], :realtime => options[:realtime] }, options.merge(:method => :post)) end
host()
click to toggle source
# File lib/tr8n/api/post_office.rb, line 63 def host application.tools['postoffice'] || POST_OFFICE_HOST end
prepare_api_path(path)
click to toggle source
# File lib/tr8n/api/post_office.rb, line 67 def prepare_api_path(path) "/api/#{POST_OFFICE_API_VERSION}#{path.first == '/' ? '' : '/'}#{path}" end
templates()
click to toggle source
# File lib/tr8n/api/post_office.rb, line 39 def templates api('templates', { :access_token => access_token }) end