Invalid email when sending through SurveyMonkey API

538 Views Asked by At

I am trying to use the SurveyMonkey API to send email surveys and I have hit many issues. The latest one is that the API will not allow email addresses with a plus sign (e.g. [email protected]). The send_flow response will have the email in the invalid_emails list. I've tried the same email on the website and I am able to add it as a recipient, so this is a validation issue on the API only. This issue makes it very hard to use the SurveyMonkey API to reliably send email surveys.

2

There are 2 best solutions below

0
On

Using email addresses with a plus in them was only recently allowed via SurveyMonkey's user interface. It will take some time for the API to catch up.

You can very reliably send email invitations using the API for email addresses which do not contain pluses.

1
On

The plus-sign in email addresses is used as a 'address tag':

Some mail services allow a user to append a tag to their email address (e.g., where [email protected] is the main address, which would also accept mail for [email protected] or [email protected]).

(wikipedia source)

You can safely remove the text between the '+' and the '@', inclusive of the '+', and the email can be delivered.

For example:

[email protected]

should be parsed to

[email protected]

In python, you can easily do this

>>> a = '[email protected]'
>>> a.split('+')[0] + '@' + a.split('@')[-1]
'[email protected]'