Class: Sendgo::SmsService
- Inherits:
-
Object
- Object
- Sendgo::SmsService
- Defined in:
- lib/sendgo/sms.rb
Overview
SMS / LMS / MMS 전송 서비스.
Instance Method Summary collapse
-
#initialize(http:, sms_sender_key:) ⇒ SmsService
constructor
A new instance of SmsService.
- #send(content:, contacts:, message_type: "SMS", campaign_type: "MESSAGE", schedule_type: "DIRECTLY", at: nil, subject: nil, files: []) ⇒ Object
- #send_lms(content:, contacts:, **opts) ⇒ Object
- #send_mms(content:, contacts:, **opts) ⇒ Object
- #send_sms(content:, contacts:, **opts) ⇒ Object
Constructor Details
#initialize(http:, sms_sender_key:) ⇒ SmsService
Returns a new instance of SmsService.
7 8 9 10 |
# File 'lib/sendgo/sms.rb', line 7 def initialize(http:, sms_sender_key:) @http = http @sms_sender_key = sms_sender_key end |
Instance Method Details
#send(content:, contacts:, message_type: "SMS", campaign_type: "MESSAGE", schedule_type: "DIRECTLY", at: nil, subject: nil, files: []) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sendgo/sms.rb', line 16 def send(content:, contacts:, message_type: "SMS", campaign_type: "MESSAGE", schedule_type: "DIRECTLY", at: nil, subject: nil, files: []) body = { campaignType: campaign_type, messageType: , scheduleType: schedule_type, at: at, subject: subject, content: content, files: files, contacts: contacts, senderKey: @sms_sender_key, } @http.post("messages/send", body) end |
#send_lms(content:, contacts:, **opts) ⇒ Object
13 |
# File 'lib/sendgo/sms.rb', line 13 def send_lms(content:, contacts:, **opts) = send(content: content, contacts: contacts, message_type: "LMS", **opts) |
#send_mms(content:, contacts:, **opts) ⇒ Object
14 |
# File 'lib/sendgo/sms.rb', line 14 def send_mms(content:, contacts:, **opts) = send(content: content, contacts: contacts, message_type: "MMS", **opts) |
#send_sms(content:, contacts:, **opts) ⇒ Object
12 |
# File 'lib/sendgo/sms.rb', line 12 def send_sms(content:, contacts:, **opts) = send(content: content, contacts: contacts, message_type: "SMS", **opts) |