Module: Email

Included in:
TessituraRest
Defined in:
lib/tessitura_rest/custom/email.rb

Instance Method Summary collapse

Instance Method Details

#send_login_credentials(template_id, email, profile_id, _params = '', options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/tessitura_rest/custom/email.rb', line 2

def (template_id, email, profile_id, _params = '', options = {})
   = (email, 1)
  return false if .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/#{.first['Id']}/Send"), options)
  post.success?
end

#send_order_confirmation(template_id, email, profile_id, order_id, _params = '', options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# 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