0
我試圖通過clickatell發送2路短信。如何爲Clickatells設置可選的mo值2路短信
我必須使用以下內容才能發送短信。
send_message(recipient, message_text, opts={})
我不得不可選莫變量設置爲1。
附加選項:
:from - the from number/name
:set_mobile_originated - mobile originated flag
下面是從clickatel的源代碼。
def send_message(recipient, message_text, opts={})
valid_options = opts.only(:from, :mo, :callback)
valid_options.merge!(:req_feat => '48') if valid_options[:from]
valid_options.merge!(:mo => '1') if opts[:set_mobile_originated]
recipient = recipient.join(",")if recipient.is_a?(Array)
response = execute_command('sendmsg', 'http',
{:to => recipient, :text => message_text}.merge(valid_options)
)
response = parse_response(response)
response.is_a?(Array) ? response.map { |r| r['ID'] } : response['ID']
end
我的大腦是油炸,我無法弄清楚如何設置這個月的變量,因爲這不起作用:
send_message(from, message, mo: '1')
關於如何設置這個可選值任何幫助嗎?