Files
odoo_source/addons/hr/models/mail_alias.py
T
Thibault Delavallée c47b0054b8 [FIX] mail, hr, test_mail: correctly Markup-ize bounce notification email content
It is currently escaped as it is not Markup-ed and not considered safe.
It means raw content is currently displayed in sent emails, which is not
really what we expect.

closes odoo/odoo#71911

X-original-commit: 62e6bc216aefe93c4cd1cca8e39f124a8a298386
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-09 11:43:11 +00:00

24 lines
836 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from markupsafe import Markup
from odoo import fields, models, _
class Alias(models.Model):
_inherit = 'mail.alias'
alias_contact = fields.Selection(selection_add=[
('employees', 'Authenticated Employees'),
], ondelete={'employees': 'cascade'})
def _get_alias_bounced_body_fallback(self, message_dict):
if self.alias_contact == 'employees':
return Markup(
_("""<p>Hi,<br/>
Your document has not been created because your email address is not recognized.<br/>
Please send emails with the email address recorded on your employee information, or contact your HR manager.</p>""")
)
return super(Alias, self)._get_alias_bounced_body_fallback(message_dict)