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.
17 lines
504 B
17 lines
504 B
import requests
|
|
|
|
from odoo import models, api
|
|
|
|
|
|
import logging
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
|
|
class MailThread(models.AbstractModel):
|
|
_inherit = 'mail.thread'
|
|
|
|
@api.model
|
|
def mailgun_fetch_message(self, message_url):
|
|
api_key = self.env['ir.config_parameter'].sudo().get_param('mailgun.apikey')
|
|
res = requests.get(message_url, headers={'Accept': 'message/rfc2822'}, auth=('api', api_key), verify=False)
|
|
self.message_process(False, res.json().get('body-mime'))
|