Friday, April 26, 2024
1 change · saas-17.2
Resolved issues and error corrections
Fixed an issue where email marketing messages could fail to send when a template contained social media icons or buttons without a web link. This helps users send standard marketing templates reliably without hidden errors blocking delivery.
Original PR description
Currently, an exception is generated when the user sends a template to a mailing that contains icons like Facebook, LinkedIn, etc. Steps to produce an exception: 1. Create a database without demo…
Currently, an exception is generated when the user sends a template to a mailing that contains icons like Facebook, LinkedIn, etc. Steps to produce an exception: 1. Create a database without demo data > install 'Email Marketing'. 2. Go to Email Marketing > Create New > Select the `Welcome Message` template. 3. Click 'Send' >> An error will occur in the log, and there is nothing to send. Error: `AttributeError: 'NoneType' object has no attribute 'startswith'` This is because at [1], we don't have `href` in 'link_node', so we receive `False` in 'original_url', and as a result, it generates an error while accessing 'original_url.startswith'. With the recently refactored code with commit https://github.com/odoo/odoo/commit/6349051e5e4442cfabc899520c5708081dc0be31, line [1] was added. Before this change, Line [2] was filtering out elements from `html` that did not have 'href'. This commit will fix the above issue by not processing to find the absolute URL if we do not have `original_url`. [1]- https://github.com/odoo/odoo/blob/b6629bbdb53d9a4bacee2032190e30a848bb6d6d/addons/link_tracker/tools/html.py#L25 [2]- https://github.com/odoo/odoo/blob/c9644a086b294e69b69e52e8ccfd5292bde815da/addons/link_tracker/models/mail_render_mixin.py#L39 sentry-5140192785