发送短信打印日志

dev_forum
daiao 6 years ago
parent daff54613d
commit fbdd7b0a71

@ -28,6 +28,8 @@ module Educoder
def self.sendYunpian(mobile, code, send_type, name, user_name, result)
#修改为您的apikey.可在官网http://www.yunpian.com)登录后用户中心首页看到
apikey = EduSetting.get('sms_apikey')
Rails.logger.info("#####apikey: #{apikey}")
Rails.logger.info("#####mobile: #{mobile}")
#指定模板发送接口HTTP地址
send_tpl_sms_uri = URI.parse('https://sms.yunpian.com/v2/sms/single_send.json')
@ -70,6 +72,7 @@ module Educoder
response = http.start { |http| http.request(request) }
ActiveSupport::JSON.decode(response.body)
rescue =>err
Rails.logger.error("#############sendYunpian_error: #{err.message}")
return nil
end
end

Loading…
Cancel
Save