From 32077cfb91fa52aa9bde7a7f694bfb0c22bf79fa Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Tue, 25 Nov 2014 18:42:09 +0530 Subject: [PATCH] CRM-11302 - Enhance unsubscribe form to reduce likelihood of accidental unsubscribes https://issues.civicrm.org/jira/browse/CRM-11302 --- CRM/Mailing/Form/Unsubscribe.php | 6 +++ templates/CRM/Mailing/Form/Unsubscribe.tpl | 52 +++++++++++++--------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/CRM/Mailing/Form/Unsubscribe.php b/CRM/Mailing/Form/Unsubscribe.php index e19e5581b1..b164f22ee5 100644 --- a/CRM/Mailing/Form/Unsubscribe.php +++ b/CRM/Mailing/Form/Unsubscribe.php @@ -70,6 +70,12 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { $groupExist = TRUE; } } + if (!$groupExist) { + $statusMsg = ts('Email: %1 has been successfully unsubscribed from this Mailing List/Group.', + array(1 => $email) + ); + CRM_Core_Session::setStatus( $statusMsg, '', 'fail' ); + } $this->assign('groupExist', $groupExist); } diff --git a/templates/CRM/Mailing/Form/Unsubscribe.tpl b/templates/CRM/Mailing/Form/Unsubscribe.tpl index 40d0038484..723098fee1 100644 --- a/templates/CRM/Mailing/Form/Unsubscribe.tpl +++ b/templates/CRM/Mailing/Form/Unsubscribe.tpl @@ -23,27 +23,37 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} - -
- -

{ts}You are requesting to unsubscribe this email address:{/ts}

-

{$email_masked}

- -

{ts}If this is not your email address, there is no need to do anything. You have not been added to any mailing lists. If this is your email address and you wish to unsubscribe please enter your email address below for verification purposes:{/ts}

- - - - - - - +
+ {if $groupExist} +
+ {ts}Are you sure you want to be removed from the mailing list(s) shown below:{/ts}
+
+
{$form.email_confirm.label}{$form.email_confirm.html} -
+ {counter start=0 skip=1 print=false} + {foreach from=$groups item=group} + + + + + {/foreach}
{$group.title}  {$group.description} 
- -
- {include file="CRM/common/formButtons.tpl" location="bottom"} -
- -
+
+

{ts}You are requesting to unsubscribe this email address:{/ts}

+

{$email_masked}

+

{ts}If this is not your email address, there is no need to do anything. You have not been added to any mailing lists. If this is your email address and you wish to unsubscribe please enter your email address below for verification purposes:{/ts}

+ + + + + + + +
{$form.email_confirm.label}{$form.email_confirm.html}
+
+ {include file="CRM/common/formButtons.tpl" location="bottom"} +
+
+
+ {/if}
-- 2.25.1