close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Unsubscribe

Thread began 5/09/2011 6:36 am by kevin.preston332611 | Last modified 7/14/2014 1:36 pm by Justin Hood | 9049 views | 29 replies |

kevin.preston332611

Unsubscribe

Hi,

By law you need to have a, unsubscribe link in an unsolicited email, otherwise its considered spam.

I saw an email suggesting you have to start developing pages with Data Assist to create the code required to unsubscribe a user.

Your FAQ state that you don't need coding knowledge or other webassist products to use Power Messenger.

So, without creating new pages or buying other products, now do I add a link for users to unsubscribe from my newsletters?

Sign in to reply to this post

Ray BorduinWebAssist

There is an unsubscribe link token you can add through the interface... or you can add it manually:

<a href="*:Unsubscribe:*">Unsubscribe</a></p>

Sign in to reply to this post

Lee Firth

I have added this token but when you click on the link in the email I get the following error:

Not Found

The requested URL /home/livingwi/public_html/newsletter/unsubscribe.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


The link should be to: /newsletter/unsubscribe.php

Sign in to reply to this post

Lee Firth

OK, further to what I have already said, I like most users it seems would like an unsubscribe feature that does not require the user to log on.

To accomplish this I have replaced the unsubscribe.php file with my own that accepts one URL parameter "UserEmail" the user is presented with a "Confirm" button which when pressed updates the database setting the "UserSubscribed" field to 0.

In my newsletter template I have added the following link:

<a href="http://newsletter.livingwisdom.com.au/unsubscribe.php?UserEmail=*:UserEmail:*">Unsubscribe</a>

This should work fine, using the UserEmail token. I have two issues. One, when I click on the "unsubscribe" link I get sent to the following URL:

newsletter.livingwisdom.com.au/home/livingwi/public_html/newsletter/link.php?id=MjdAQF9QTV9TRVBfQEAxQEBfUE1fU0VQX0BAMjM=

This link is not resolving correctly to the root of my website (the part in red is superfluous)

Secondly when I remove the the red portion of the url and refresh the page, I'm sent to:

unsubscribe.php?UserEmail=*:UserEmail:*

As you can see the UserEmail token has not resolved correctly.

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

Henrik

I also would like to provide a possibility to unsubscribe without to require the user to log in.

I would like to have it like this:

User clicks the Unsubscribe link in the email and is taken to a new page lets say
unsubscribe_request.php.

This page has a form with only one field where the user enters the email-address
he wants to unsubscribe. (Similar like the email password page.)

If he clicks "send" the database IS NOT immediately updated by setting the
"UserSubscribed" field to 0 - like suggested in the post before.

Instead an email is sent to the entered email-address:

If you want to unsubscribe from the list please click here: "Unsubscribe-Link"

If this link is clicked the appropriate email will be subscribed by updating the database
setting the "UserSubscribed" field to 0.

(The step sending an email to the entered email-address is important, so that
no one can unsubsubscribe an email that doesn't belong to them!)

My Question is:

How should be the code of this last "Unsubscribe-Link" to achieve the result of
finding the right email address in the database and setting the "UserSubscribed"
field to 0 ?

Thank you!

Sign in to reply to this post

Lee Firth

Unsubscribe With No Login

For those of you who want the option of users unsubscribing without having the user log in, this is the way it was accomplished in my case:

1. Create a new page called unsubscribe_confirmation.php using the themed_content template. Add whatever message you want to display after the user has unsubscribed i.e. "You have been unsubscribed from our Newsletter." in the "main" editable region.

2. Open the file unsubscribe.php Select "SecurityAssist Restrict Access to Page" in the Server Behaviors panel and click the minus button to delete it.

3. Go to code view in the file and search for where the variable $canView is set and change the value set to "true" i.e in my case this was line 24

$canView = getUserCanViewPage($MailingInfo);

Change it to...

$canView = true; // getUserCanViewPage($MailingInfo);

and line 90

$canView = getUserCanViewPage($qsID);

change to...

$canView = true; //getUserCanViewPage($qsID);

4. Change the redirects to send you to the file you created in step one. In my case there were two, one in line 40

$WA_redirectURL = "unsubscribe_confirmation.php";

and one in line 78

header('Location: unsubscribe_confirmation.php');

Save the file and that's it. I realise that there are probably other ways to do this, but this gives the desired result for me.

Sign in to reply to this post

troyd

Originally Said By: Lee Firth
  For those of you who want the option of users unsubscribing without having the user log in, this is the way it was accomplished in my case:

...  



Can this be done for the "View this email in a browser?
It seems that some people are not willing to log in to see the newsletter.

Just wondered if it could be done or not.

Thanks
TroyD

Sign in to reply to this post

Jason ByrnesWebAssist

register a dummy user in the power messenger users database and make note of the user ID.

then in the archive.php file, change the following code:


php:
<?php

if (!WA_Auth_RulePasses("Logged in to users")){
    
WA_Auth_RestrictAccess("users_login.php");
}
?>




to:

php:
<?php

$_SESSION
["UserID"] = 1;
/*if (!WA_Auth_RulePasses("Logged in to users")){
    WA_Auth_RestrictAccess("users_login.php");
}*/
?>




where 1 is the ID of the dummy user created

then find this code:

php:
if($content){

                    echo ($content);
                    exit();
                }



and unset the user session;

php:
if($content){

                    echo ($content);
                    if(isset($_SESSION["UserID"])) unset($_SESSION["UserID"]);
                    exit();
                }
Sign in to reply to this post

troyd

Thanks Jason.

I made all the changes to the archive.php file and a dummy account was created using the ID 1. This worked for the email sent to the dummy account (maybe I shouldn't have entered one). However, my other test account can't see the email in the browser without first logging in.

So to recap. Email was sent out, only two in the audience.
1-Dummy account to real email address
2-Test user account to different email address

Logged out, cleared all history and cookies, closed browser.
Clicked on Test users email but it wants me to log in.
Clicked on Dummy account email and it opens perfectly in the browser without logging in.

So it seems to be setting the session that user with ID 1 is automatically logged in when clicking from their email but won't let anyone else view it. Did I miss a step?

Thanks
TroyD

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...