76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/vonage/sms.rb', line 76
def send(params)
if unicode?(params.fetch(:text)) && params[:type] != 'unicode'
message = 'Sending unicode text SMS without setting the type parameter to "unicode". ' \
'See https://developer.nexmo.com/messaging/sms for details, ' \
'or email [email protected] if you have any questions.'
logger.warn(message)
end
response = request('/sms/json', params: hyphenate(params), type: Post)
unless response.messages.first.status == '0'
raise ServiceError.new(response: response), response.messages.first[:error_text]
end
response
end
|