Class: Istox::MessageService
- Inherits:
-
Object
- Object
- Istox::MessageService
- Defined in:
- lib/istox/helpers/message_service.rb
Class Method Summary collapse
- .send_email(email, subject, content) ⇒ Object
- .send_email_template(email, template) ⇒ Object
- .send_sms(number, subject, content) ⇒ Object
- .send_sms_template(number, template) ⇒ Object
Class Method Details
.send_email(email, subject, content) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/istox/helpers/message_service.rb', line 21 def send_email(email, subject, content) publish('email', data: { to: email, subject: subject, type: 'text/plain', body: content }, type: __method__.to_s.upcase!) end |
.send_email_template(email, template) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/istox/helpers/message_service.rb', line 31 def send_email_template(email, template) publish('email', data: { to: email, template: template }, type: __method__.to_s.upcase!) end |
.send_sms(number, subject, content) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/istox/helpers/message_service.rb', line 4 def send_sms(number, subject, content) publish('sms', data: { to: number, subject: subject, body: content }, type: __method__.to_s.upcase!) end |
.send_sms_template(number, template) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/istox/helpers/message_service.rb', line 13 def send_sms_template(number, template) publish('sms', data: { to: number, template: template }, type: __method__.to_s.upcase!) end |