This commit is contained in:
guange 2016-04-09 18:17:07 +08:00
commit beec2b3246
5 changed files with 25 additions and 6 deletions

View File

@ -110,7 +110,11 @@ class BlogComment < ActiveRecord::Base
} }
} }
logger.info "start send template message: #{data}" logger.info "start send template message: #{data}"
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[blog_comment] ===> #{e}"
end
logger.info "send over. #{req}" logger.info "send over. #{req}"
end end
end end

View File

@ -135,7 +135,11 @@ class HomeworkCommon < ActiveRecord::Base
} }
} }
logger.info "start send template message: #{data}" logger.info "start send template message: #{data}"
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[homework_common] ===> #{e}"
end
logger.info "send over. #{req}" logger.info "send over. #{req}"
end end
end end

View File

@ -271,7 +271,11 @@ class Journal < ActiveRecord::Base
} }
} }
logger.info "start send template message: #{data}" logger.info "start send template message: #{data}"
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[journal] ===> #{e}"
end
logger.info "send over. #{req}" logger.info "send over. #{req}"
end end
end end

View File

@ -340,7 +340,11 @@ class JournalsForMessage < ActiveRecord::Base
} }
} }
logger.info "start send template message: #{data}" logger.info "start send template message: #{data}"
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[journal_for_message] ===> #{e}"
end
logger.info "send over. #{req}" logger.info "send over. #{req}"
end end
end end

View File

@ -1155,9 +1155,12 @@ class Mailer < ActionMailer::Base
} }
logger.info "start send template message: #{data}" logger.info "start send template message: #{data}"
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[mailer] ===> #{e}"
end
logger.info "send over. #{req}" logger.info "send over. #{req}"
end end
end end
end end