Mailchimp rejects some emails immediately; these include emails @example.org and emails which look badly formatted.
If your site URL was http://example.dev:1234 then the previous code would generate an email that Mailchimp rejected as invalid. This should ensure the domain is JUST the domain from CIVICRM_UF_BASEURL.
To reproduce -
Dev site is at http://example.dev:8000
Run tests
Lots of failures because Mailchimp rejects email address of form foo@example.dev:8000
Mailchimp rejects some emails immediately; these include emails
@example.org
and emails which look badly formatted.If your site URL was http://example.dev:1234 then the previous code would generate an email that Mailchimp rejected as invalid. This should ensure the domain is JUST the domain from
CIVICRM_UF_BASEURL
.To reproduce -
http://example.dev:8000
foo@example.dev:8000
To address -
parse_url()
instead ofpreg_replace()