The newest version of Sendy has this feature built in. This edit is no longer needed.
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
//vars $time = time(); $feedback = ''; $unsublink = $_GET['i']; //get variable if(isset($_GET['i']))
Step 2:
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.
//vars ?> <html><head> </head><body> <div style="margin: 0px auto;width:400px;margin-top:100px"> <p>Do you want to unsubscribe this address?</p> <?php echo strtolower($email); ?> <p> </p> <form action="https://mylist.domain.com/unsub.php?i=<?php echo $unsublink;?>" method="POST" accept-charset="utf-8"> <input type="submit" name="submit" id="submit" value="Yes, unsubscribe <?php echo strtolower($email); ?>"/> </form> </div> </body></html> <? else { echo("https://mylist.domain.com/unsub.php?i=<?php echo $unsublink;?>"); }
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.)
Hi Diane, I get this error any ideas Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file in /homepages/14/d69925251/htdocs/mydomain.com/mail/unsubscribe.php on line 103
Thanks
Further to my post Sendy has a double unsubscribe feature meaning the subscriber has to click a link to unsubscribe then gets a page asking if they want to unsubscribe, you can test it here: http://email256.com/mail/subscription?f=VzI04Npdl8zp8KpGkyireQoX83T763A1892IcsFAkLJYycDHebtNSf4763kDzfrA76311Vev
Correct, the newest versions of Sendy have the feature built in. You don't need this.
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.
Hi Diane:
How can I contact you?
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.