4

This is picking up on a topic from the old forum having to do with unsubscribe confirmation. (This feature is present in CiviCRM 4.6.2 as well as 4.5.8.) I agree that having to enter one's email address is an additional annoyance to someone who is probably already annoyed.

What happens next in the process is also confusing. Once the unsubscribing user enters their email address and clicks "unsubscribe" a highlighted confirmation message appears near the top of the screen, but the original highlighted "are you sure?" message and confirmation entry form still appear just below, as if the user is being asked to confirm again. As a workaround, I'm using only {action.unsubscribe} and avoiding {action.unsubscribeURL}.

I understand that at present there is no way to override the "enter your email address to confirm" process. But is there any way to show the now-confirmed user a simple "you've been removed" message without repeating the original confirmation template contents? Perhaps a second template displayed at the end of the process?

If someone could give me a hint about where to start looking in the code, I'd be willing to have a go at displaying a simple post-confirmation message and submitting a patch.

2

Most of the code for the actual unsubscribe process is located here:

CRM/Mailing/Form/Unsubscribe.php

Would be good to:

a. Create a site wide CiviMail setting so an admin can disable the email confirmation process.

b. Use this site wide setting to determine the behavior of the code, the new behavior or the 4.4 and prior behavior. The 4.4 code is here:

CRM/Mailing/Page/Unsubscribe.php

1

Caveat: This simple hack works fine when a user is unsubscribing from one or more regular groups. It has no effect when there is a smart group in the mix.

Avoiding the confusing re-display of the confirmation dialog turned out to be pretty easy. Around line 129-130 in "public function postProcess()" in CRM/Mailing/Form/Unsubscribe.php add this code:

$groupExist = NULL;

Put it just before this line:

CRM_Core_Session::setStatus($statusMsg, '', 'success');

With this fix, when the user correctly enters their email address and clicks "Unsubscribe" they get a confirmation message only.

I may be missing something more complex here, but I'm thinking the absence of this single line in the original code may have just been an oversight.

Avoiding the whole email address entry confirmation is also straightforward, and involves removing (or skipping over) a few lines of code in the same php file and the templates/CRM/Mailing/Form/Unsubscribe.tpl template file.

The best solution is to control this behavior with a system-wide option, as Donald Lobo suggests. More study needed on my part.

Addendum: I also suggest that the text "Please Confirm your" be removed from the page title heading (also set in CRM/Mailing/Form/Unsubscribe.php) so that it simplified to "Unsubscribe from Mailing/Group". This still works for the confirmation request phase and makes more sense in the context of a "You have been unsubscribed" confirmation.

  • I muddied the water with this previous answer. Putting aside the issue of suppressing the email verification process altogether (thanks @donald-lobo), there remains a bug that shows when the contact is trying to unsubscribe via web page from a mailing sent to a smart group. In such cases the contact is presented with the entire verification page over and over, even after correctly submitting a valid email address. The "successfully unsubscribed" message is easy to miss when being asked (apparently) to verify again. Unsubscribing from a static group is much cleaner by comparison. – charlie Jun 13 '15 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.