module Email

Public Instance Methods

send_login_credentials(template_id, email, profile_id, params = '', options={}) click to toggle source
# File lib/tessitura_rest/custom/email.rb, line 3
def send_login_credentials(template_id, email, profile_id, params = '', options={})
  login_id = get_web_login(email, 1)
  return false if login_id.empty?
  parameters =
  {
    'TemplateId': template_id,
    'EmailAddress': email,
    'EmailProfileId': profile_id
  }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
  post = self.class.post(base_api_endpoint("Emails/LoginCredentials/#{login_id.first['Id']}/Send"), options)
  post.success?
end
send_order_confirmation(template_id, email, profile_id, order_id, params = '', options={}) click to toggle source
# File lib/tessitura_rest/custom/email.rb, line 18
def send_order_confirmation(template_id, email, profile_id, order_id, params = '', options={})
  parameters =
  {
    'TemplateId': template_id,
    'EmailAddress': email,
    'EmailProfileId': profile_id
  }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
  post = self.class.post(base_api_endpoint("Emails/OrderConfirmation/#{order_id}/Send"), options)
  post.success?
end