Add a Confirm Unsubscribe Link in Sendy

Published on February 14, 2016 Last reviewed on May 3, 2017

This is as much for me to remember what in the heck I did so i can redo it the next time Sendy gets updated and I couldn't find anything online that told how to do this. I've learned over the years of helping people that others are probably looking for this too, so I'm putting it online instead of in OneNote.

The problem: I didn't like that clicking the Unsubscribe link in emails generated by Sendy immediately unsubscribed the address. I wanted a 'are you sure?' page to confirm because any antivirus or proxy scanner that verifies link will unsubscribe the address. IMHO, the is a shortcoming in the software and is a feature that should be built into it. (Another shortcoming is not recording IP Address used to subscribe - this is a must in any newsletter software but that will be another post.)

While I could set it up to send a good-bye email when someone signed off, if the proxy unsubscribes a person frequently, the subscriber will get tired of resubscribing.

First I had to find the file that had the code that unsubscribed the person from the list and make a copy. This would be unsubscribe.php (DOH!). I used the top part of the unsubscribe code (down to line 79) in file that has the unsubscribe button.

At the end of the file, I added a form with a button to click to unsubscribe. When the button is clicked, the original unsubscribe page loads and the user is unsubscribed. There is an else statement to load the original unsubscribe page should something go wrong.

Step 1:
At around line 46, add $unsublink = $_GET['i'];. This gets the variable that is passed in the unsubscribe link. If anything

Next find else if(isset($_POST['email'])). Delete it and everything to the end. Replace it with the following code.

As seen in the screenshot above, after making these changes, the page displays the decoded email address in the button. When the button is clicked, the new link to unsubscribe is called and the address is removed from the list.

If if(isset($_GET['i'])) is not true, the new unsub link is called and processed.

Rename the original version unsub.php and the copy to unsubscribe.php and it's ready for testing.

My finished unsubscribe file in here: unsubscribe php. You can use it - just don't forget to change the domain.

To use https://mylist.domain.com/unsub/{unsubscribe code} as the link, you'll need to update the URL rewrites in the .htaccess file. (IIS users will update the web.config file... yes, Sendy works just fine on IIS.)

Related posts:

4

Leave a Reply

2500

1Comment threads

3Thread replies

2Followers

Most reacted comment

Hottest comment thread

3Comment authors

2500

Subscribe

newestoldestmost voted

Notify of

oginternetuser

Now how do I add the actual unsubscribe link in the HTML code?. Also I think you might be missing some code near the end pertaining to the phrase "Delete it and everything else". There is a lot of important code past that point. Did you mean to say everything else inside the corresponding bracket?

Yeah, it does look like something is missing. I'll check it in my installation. Ok... the code is correct. I've uploaded my new unsubscribe page - it's at unsubscribe php

You need to make a copy of the original unsubscribe php file. Rename one unsub.php. The unsub.php file won't be edited. The unsubscribe page is edited to replace the code that removes the name from the list with the button to confirm it. Then the page with the original code is loaded and the address unsubed.

if you need help with outlook, you can schedule a meeting at https://shop.slipstick.com/services. If it's something else, you can ask in the comments here or at slipstick.com. My email is diane @ slipstick but i get tons of mail and am often slow to answer.