CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Forwarded unsubscribe / optOut URLs
Pages: [1]

Author Topic: Forwarded unsubscribe / optOut URLs  (Read 1907 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Forwarded unsubscribe / optOut URLs
April 23, 2008, 05:54:39 pm
We are about to launch an email campaign, and recognising that people will (hopefully!) forward messages to their friends and colleagues, we wanted to deal with potential unsubscribes affecting the wrong recipient. Eg, if Dave receives a CiviMail with an unsubscribeUrl, and forwards it to Jess, { ... repeat ... } then the final recipient might click on the unsubscribeUrl and unsubscribe Dave.

CiviCRM does notify the user of the address which is to be unsubscribed, but given people's strong dislike for unexpected email we thought that some folks might click through the unsubscribe button without reading. Easy to do.

So, with a bit of tweaking (and using only a custom template) I've added some code that helps ensure the user really wants to unsubscribe the address that the URL affects, by asking them to enter it into a checkbox.

I've got a couple of finishing tweaks to make, then I'll post the code here. I'd like it available to others, and also I had to code it using jQuery (I'm less familiar with Dōjō) and would love it if a Dōjō speaker could give me tips on how to use that toolkit as well, so it's available to all CiviCRM users.

(Hey ... doesn't Joomla package jQuery by default now too?)
@xurizaemon ● www.fuzion.co.nz

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Forwarded unsubscribe / optOut URLs
April 24, 2008, 03:18:24 am
This is very cool.

Are you planning on using the {action.forward} token so that at least some folks will forward the message in a less haphazard way?
Protect your investment in CiviCRM by  becoming a Member!

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Forwarded unsubscribe / optOut URLs
April 24, 2008, 07:14:46 am
Yes - I didn't know about that feature at first but discovered it in the list of CiviMail action tokens.

However, we aren't anticipating that any great portion of users will be able to resist the allure of familiar methods - like hitting the fwd button ... :S
@xurizaemon ● www.fuzion.co.nz

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Forwarded unsubscribe / optOut URLs
November 24, 2010, 06:30:44 pm
ah - you gotta love these old threads
Code: [Select]
then I'll post the code herehate doing this to you chris, but have just been asked if we could implement this (having told client i knew it had been done before)

Any chance of you nailing it up here?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Forwarded unsubscribe / optOut URLs
November 24, 2010, 06:36:47 pm
And dgg - any thought about taking something like this in to core as it seems like a useful enhancement to me - unless you know others would be annoyed with requiring their 'opt outers' to have to type in their email address as confirmation.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Forwarded unsubscribe / optOut URLs
November 24, 2010, 11:11:24 pm
Hi,

Very selfish and personal issue maybe, but I never remember what email address I put (got half a dozen domains, catchall mix with + notation...).

Asking me my email to unsubscribe me really (really) pisses me off. You spammed me, you should know, not me ;)

However, displaying clearly what email you are unsubscribing  would be great indeed.

On a related note, is there a way to unsubscribe from a group only instead of for all?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Forwarded unsubscribe / optOut URLs
November 25, 2010, 12:35:17 am
@peted: you are SO lucky i stumbled in today of all days. here you go!

Code: [Select]
{if $confirm}
<div class="messages status">
    <dl>
      <dt><img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}" /></dt>
      <dd><label>{$display_name} ({$email})</label> {ts}has been successfully unsubscribed.{/ts}</dd>
    </dl>
</div>
{else}
<div>
    <form action="{$confirmURL}" method="post" onSubmit="return validateOptout();" >
      {if $groupExist}
        <div class="messages status">
          Unsubscribing {ts 1=$display_name 2=$email} %1 (%2){/ts}<br/>
        </div>
<p>
Before we unsubscribe you, we'd like to check that you didn't get this email from a friend who
forwarded it to you, in which case you may not actually be subscribed to this mailing list.
</p>
<p><b>Please confirm</b> that you are the final recipient of the address <em>{$email}</em> by typing that email address in the box below.</p>
<h2>Type this email address below to complete opt-out:</h2>
<h3>{$email}</h3>
<br>
<input type="text" name="confirm_address" value="" size="36" id="optout-entry">
<input type="hidden" name="confirm_address_check" value="{$email}" id="optout-check"><br><br>
</p>

<p>You are requesting unsubscription from the following mailing lists:</p>

            <table class="selector" style="width: auto;">
                {counter start=0 skip=1 print=false}
                {foreach from=$groups item=group}
                <tr class="{cycle values="odd-row,even-row"}">
                 <td><strong>{$group.title}</strong></td>
                 <td>&nbsp;&nbsp;{$group.description}&nbsp;</td>
                </tr>
                {/foreach}
            </table>
        <center>
          <input type="submit" name="_qf_unsubscribe_next" value="{ts}Unsubscribe{/ts}" class="form-submit" />&nbsp;&nbsp;&nbsp;
           <input type="submit" name="_qf_unsubscribe_cancel" value="{ts}Cancel{/ts}" class="form-submit" />
        </center>
      {else}
        <div class="messages status">
          {ts 1=$display_name 2=$email} %1 (%2){/ts}<br/>
          {ts}Sorry, you are not on the mailing list. You are probably already unsubscribed.{/ts}<br/>
        </div>
      {/if}
    </form>
</div>
{/if}
<script type='text/javascript'>
{literal}
var iToldYouOnce = false ;
function validateOptout() {
  var inputEntry = $('#optout-entry') ;
  var checkEntry = $('#optout-check') ;
  if ( inputEntry.val().toLowerCase() != checkEntry.val().toLowerCase() ) {
    if ( !iToldYouOnce ) {
      $(inputEntry).after('<br><br><span style="color:red;font-weight:900">' +
        'It appears that the email address you typed in is not the one to which this ' +
        'email was originally sent.<\/span>');
      iToldYouOnce = true ;
    }
    return false ;
  }
}
{/literal}
</script>


@xavier: i agree - that's why the form says, in short:

"you are subscribed as xavier@example.org. to unsubscribe, type 'xavier@example.org' in this box first. thanks!"

worst case scenario, it displays the email of the person who started the FWD chain which the final recipient has tried to hit unsubscribe on.
@xurizaemon ● www.fuzion.co.nz

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Forwarded unsubscribe / optOut URLs
November 25, 2010, 12:52:49 pm
brilliant chris - now it may be just me that goes 'hm, now i wonder where this is meant to be added' and eileen will jump to the right conclusion, but happy to get a hint
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Forwarded unsubscribe / optOut URLs
November 25, 2010, 07:20:00 pm
civicrm/templates/CRM/Mailing/Page/Unsubscribe.tpl I believe. (From memory!)
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Forwarded unsubscribe / optOut URLs

This forum was archived on 2017-11-26.