You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
503 B

  1. # -*- coding: utf-8 -*-
  2. from openerp.addons.web import http
  3. from openerp.addons.web.http import request
  4. import werkzeug
  5. import email
  6. import requests
  7. import simplejson
  8. class MailMailgun(http.Controller):
  9. @http.route('/mailgun/notify', auth='public', type='http', csrf=False)
  10. def mailgun_notify(self, **kw):
  11. # mailgun notification in json format
  12. message_url = kw.get('message-url')
  13. request.env['mail.thread'].sudo().mailgun_fetch_message(message_url)
  14. return 'ok'