Class: LucidIntercom::SendEmail
- Inherits:
-
Object
- Object
- LucidIntercom::SendEmail
- Defined in:
- lib/lucid_intercom/send_email.rb
Instance Method Summary collapse
- #call(to, subject, body) ⇒ Object
-
#initialize(post_request: Container[:post_request]) ⇒ SendEmail
constructor
A new instance of SendEmail.
Constructor Details
#initialize(post_request: Container[:post_request]) ⇒ SendEmail
Returns a new instance of SendEmail.
10 11 12 |
# File 'lib/lucid_intercom/send_email.rb', line 10 def initialize(post_request: Container[:post_request]) @post_request = post_request end |
Instance Method Details
#call(to, subject, body) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/lucid_intercom/send_email.rb', line 19 def call(to, subject, body) @post_request.('messages', { message_type: 'email', subject: subject, body: body, template: 'plain', from: { type: 'admin', id: LucidIntercom.config.admin_id, }, to: { type: 'user', email: to, }, }) end |