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
542 B

  1. # Copyright 2018 Camptocamp SA
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
  3. from odoo import http
  4. from odoo.http import request
  5. class EmailBrowserViewController(http.Controller):
  6. @http.route(['/email/view/<string:token>'],
  7. type='http', auth='public', website=True)
  8. def email_view(self, token, **kwargs):
  9. record = request.env['mail.mail'].get_record_for_token(token)
  10. if not record:
  11. return request.not_found()
  12. return request.make_response(record.body_html)