Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle double opt-in when user has attempted signup before #7

Open
houmark opened this issue Oct 6, 2016 · 0 comments
Open

Handle double opt-in when user has attempted signup before #7

houmark opened this issue Oct 6, 2016 · 0 comments

Comments

@houmark
Copy link

houmark commented Oct 6, 2016

I submitted a PR to improve the handling of signups. More details in the pull request itself.

Basically we saw that when someone attempted signup but didn't finish by confirming in the mail, because the mail was not delivered for some reason, it would be impossible for that e-mail to get on the list through this extension on a later attempt.

After chatting with MailChimp tech support and reading up on their docs, the solution was to either do a PUT request on the first signup attempt, or catch the "existing membership" when doing the POST and then do a PUT request.

Since a PUT request will also change subscribed to pending for an existing user the best solution is to do a POST request, catch the "error", do a GET request for the current status of the mail (the POST does not provide this information) and if that status is not "subscribed" then do the PUT request to set the user to pending. When that happens, MailChimp will automatically send the confirmation mail again. This 3-step routine prevents an existing user from changing from "subscribed" to "pending" and we will still output the "you are already signed up" message.

If the user is not on the list in any way, only one POST request is sent and that one will of course also trigger the confirmation mail.

Hope to see this merged soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant