Module: Email
- Included in:
- TessituraRest
- Defined in:
- lib/tessitura_rest/custom/email.rb
Instance Method Summary collapse
- #send_email(recipient, body, subject, sender, options = {}) ⇒ Object
- #send_login_credentials(template_id, email, profile_id, _params = '', options = {}) ⇒ Object
- #send_order_confirmation(template_id, email, profile_id, order_id, _params = '', options = {}) ⇒ Object
Instance Method Details
#send_email(recipient, body, subject, sender, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/tessitura_rest/custom/email.rb', line 31 def send_email(recipient, body, subject, sender, = {}) parameters = { 'RecipientAddress': recipient, 'HtmlBody': body, 'FromAddress': sender, 'Subject': subject, 'EmailProfileId': 7, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json) self.class.post(base_api_endpoint('Emails/Send'), ) end |
#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 send_login_credentials(template_id, email, profile_id, _params = '', = {}) login_id = get_web_login(email, 1) return false if login_id.empty? parameters = { 'TemplateId': template_id, 'EmailAddress': email, 'EmailProfileId': profile_id, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json) post = self.class.post(base_api_endpoint("Emails/LoginCredentials/#{login_id.first['Id']}/Send"), ) 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 = '', = {}) parameters = { 'TemplateId': template_id, 'EmailAddress': email, 'EmailProfileId': profile_id, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json) post = self.class.post(base_api_endpoint("Emails/OrderConfirmation/#{order_id}/Send"), ) post.success? end |