Jump to content

Mailing list unsubscribe


Robin Somes

Recommended Posts

CC 6.06
Appears to be a slight issue with subscription to the mailing list, which I'm keen to get sorted before I start annoying actual paying customers with it ;)

I've sent a couple of test newsletters, with the standard footer telling those who wish to unsubscribe to go to:

http://www.piscesconservation.com/cube/index.php?_a=unsubscribe

However, entering my regular email address - which is in the mailing list - only produces the message that "Email address already subscribed".

Entering a variety of other addresses either produces "Email address already subscribed" (which it isn't), "Please enter a valid email address" (It IS a valid email address!), or an annoying state of pressing the button and nothing at all happening.

Nowhere does an email address actually get unsubscribed.

Any suggestions?

TIA, Robin

Link to comment
Share on other sites

In my opinion, there is an incredible amount of irrelevant, possibly misleading, work going on 'validating' this form. The evidence of this bad work is the smaller red block of text below the text entry field as opposed to CubeCart's red-ish banner at the top. We can try to remove it from being 'validated'.

Other than that, from the Newsletter page... There are two ways to get an address into the Newsletter Subscribe/Unsubscribe process: in the form POST, or in the web address URL (GET).

By POST:
First, CubeCart will try to subscribe the email. If that fails for whatever reason, CubeCart then determines if the visitor is logged in.

If logged in, and because subscribing had failed, then CubeCart says, "Please enter a valid email address." Which is very misleading because the major way subscribing fails is if the email address already exists. So, 'valid' probably means to want you to enter an address that doesn't already exist.

If not logged in, and because subscribing had failed, then CubeCart tries to unsubscribe that address.

By GET:
This method requires a web address such as: [email protected]

This is easy to program into the newsletter content.

There is something not happening correctly. Still tracing it out. Cubecart's banner saying "You have been..." is missing and the resulting URL in the browser's address bar is wrong. My bad.

Link to comment
Share on other sites

The Validator is blocking the form's submission because when having entered the email address of an email that exists, the ajax call received a false from CubeCart. What the validator does with this false, I cannot yet determine, but the form will not submit.

Link to comment
Share on other sites

Unless you send large numbers of emails, MailChimp is free. But it does not integrate with CC as well as it did before the double opt-in started. I've tried to use MC code and integrate it with CC, and it works up to a point, but it takes the customer to a confirmation page off CC (with a link back to the store).

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

 

 This method requires a web address such as: [email protected]

Does anybody know of a GET URL that works?

I have tried the following, none of which appear to work:

mywebsiteURL/Store/index.php?_a=newsletter&[email protected] 
mywebsiteURL/Store/index.php?_a=unsubscribe&email
mywebsiteURL/Store/[email protected]
mywebsiteURL/Store/[email protected]
mywebsiteURL/Store/index.php?_a=unsubscribe&[email protected]
mywebsiteURL/Store/index.php?_a=newsletter&action=unsubscribe&[email protected]

Link to comment
Share on other sites

Well I tried Brian's example, using the CCV6.0.8 version of cubecart.class.php, and got the empty Newsletters/Subscription screen, as if I had entered

mywebsiteURL/Store/index.php?_a=unsubscribe without the additional GET variable. If I then enter the [email protected] email address into the form, I get the message "your email address has been added to our list", even though I was already a subscriber. If I look at the CubeCart_newsletter_subscriber table, I can see that the email address now has a new subscriber_id, as if it had unsubscribed and then subscribed again all in the same transaction! Most odd.

I have also tried a code change as recommended by SemperFiWS in the Github issue that I raised. The only difference is that Semper's code issues an error message on the first screen, "The following errors were detected: Please enter a valid email address". If I then enter [email protected] as before, I get the same result as before.

Link to comment
Share on other sites

Several things are interfering. (I haven't looked at the Github comments yet.)

This is what I did:

In cubecart.class.php, near lines 2150-2151:

if (isset($_GET['unsubscribe']) && filter_var($_GET['unsubscribe'], FILTER_VALIDATE_EMAIL)) {
	if ($newsletter->unsubscribe($_GET['unsubscribe'])) {

Change to:

if (isset($_GET['unsubscribe']) && filter_var($_GET['unsubscribe'], FILTER_SANITIZE_EMAIL, FILTER_VALIDATE_EMAIL)) {
	if ($newsletter->unsubscribe(filter_var($_GET['unsubscribe'], FILTER_SANITIZE_EMAIL))) {

Then, the link URL to put in emails, etc, is:

mywebsiteURL/Store/index.php?_a=unsubscribe&unsubscribe="[email protected]"

Note the quotes around the address. This is necessary to prevent CubeCart's SEO class from misinterpreting the URL as an SEOable() URL.

I have a few ideas on a better fix. I'll post them in the Github soon.

Also be aware that CubeCart should show the "You have been unsubscribed" banner. But this will be confusing to the logged in customer in a certain scenario. If a customer is logged in, but manually enters the URL above, and the email address is not the customer's logged-in email address, CubeCart will still delete the address, show the banner, but then also show the "You are subscribed" message (if in fact the customer is) with an unsubscribe button. But this button is for the customer's logged-in email address.

 

Link to comment
Share on other sites

We still seem to have an intermittent problem with this whilst using phpList.

We have testing this for the last few days, and find that occasionally the link from an email, when clicked, seems to lose the quotes around the email address.

For example,  the link mywebsiteURL/Store/index.php?_a=unsubscribe&unsubscribe="[email protected]" becomes 

mywebsiteURL/Store/index.php?_a=unsubscribe&[email protected]

and what you see in the browser address bar is mywebsiteURL/Store/index.php?_a=unsubscribe&unsubscribe=abc

I can't see any consistency in why it happens - my only thought is maybe it's session or cookie related as it has just been the three of us testing it.

As a result we don't think we can use this just yet. I will have to watch out for Brian's other ideas.

  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...