Class: Notisend::Resources::Messages
- Defined in:
- lib/notisend/resources/messages.rb
Overview
Single email messages: POST /email/messages, GET /email/messages/:id
Instance Method Summary collapse
- #deliver(from_email:, to:, subject:, text: nil, html: nil, from_name: nil, payment: nil, smtp_headers: nil, attachments: nil) ⇒ Object
- #get(id:) ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Notisend::Resources::Base
Instance Method Details
#deliver(from_email:, to:, subject:, text: nil, html: nil, from_name: nil, payment: nil, smtp_headers: nil, attachments: nil) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/notisend/resources/messages.rb', line 7 def deliver(from_email:, to:, subject:, text: nil, html: nil, from_name: nil, payment: nil, smtp_headers: nil, attachments: nil) payload = { from_email:, to:, subject:, text:, html:, from_name:, payment:, smtp_headers: }.compact client.post(email_path('messages'), payload, attachments: ) end |
#get(id:) ⇒ Object
14 15 16 |
# File 'lib/notisend/resources/messages.rb', line 14 def get(id:) client.get(email_path('messages', id)) end |