diff --git a/modules/marketing_automation/marketing_automation.py b/modules/marketing_automation/marketing_automation.py index 6cf07809a6..1e3c95156f 100644 --- a/modules/marketing_automation/marketing_automation.py +++ b/modules/marketing_automation/marketing_automation.py @@ -567,7 +567,7 @@ class Activity(ModelSQL, ModelView): for kind, data, pos in stream: if kind is START: tag, attrs = data - if tag == 'a': + if tag == 'a' and attrs.get('href'): href = attrs.get('href') attrs -= 'href' if href.startswith('unsubscribe'): diff --git a/modules/marketing_email/marketing.py b/modules/marketing_email/marketing.py index 7242cd6034..470fa7fec9 100644 --- a/modules/marketing_email/marketing.py +++ b/modules/marketing_email/marketing.py @@ -425,7 +425,7 @@ class Message(Workflow, ModelSQL, ModelView): for kind, data, pos in stream: if kind is START: tag, attrs = data - if tag == 'a': + if tag == 'a' and attrs.get('href'): href = attrs.get('href') attrs -= 'href' href = short(href, str(message))