Thanks for sharing the updated info on the custom landing pages, relevant to 2.10.9.
I further tweaked the one for confirming the email link once clicked, to parse some variables to the custom landing page.
mails/index.php
aprox. around line 544
added the id field, highlighted with ** to the select part of the following code;
- Code: Select all
$req = Sql_Query(sprintf('select id**,name,description from %s list, %s listuser where listuser.userid = %d and listuser.listid = list.id and list.active',$tables['list'],$tables['listuser'],$userdata['id']));
Then added a line to create a pipe delimited string of list id's that the user has subscribed to.
find the following line of code around 550
- Code: Select all
$html .= '<li>'.stripslashes($row["name"]).'<div>'.stripslashes($row["description"]).'</div></li>';
and added the following line;
- Code: Select all
$listids .= stripslashes($row["id"]).'|';
add an outcome flag variable in the following two places.
find the following line of code around 570
- Code: Select all
$info = $GLOBALS["strConfirmInfo"];
and added the following line;
- Code: Select all
$regemailoutcome = "success";
find the following line of code around 574
- Code: Select all
$info = $GLOBALS["strConfirmFailInfo"];
and added the following line;
- Code: Select all
$regemailoutcome = "fail";
Then updated the header url from the mod to take you to the custom landing page from clicking the link in the subscribe email.
- Code: Select all
$res = header('Location: http://www.yourdomain.co.uk/yourcustomlandingpage.php?outcome='.$regemailoutcome .'&lists='.$listids);
Then around the center of the code in my custom landing page I have put;
- Code: Select all
$outcome = $_GET['outcome'];
$lists = $_GET['lists'];
$listarray = explode('|',$lists);
if($outcome == "success")
{
echo "Thank you for confirming your subscription. The newsletters you are subscribed to are listed below.<br><br>\n";
if(in_array("1", $listarray))
echo "test<br>\n";
if(in_array("2", $listarray))
echo "Title for list2<br>\n";
}
else
{
echo "Sorry, your request for confirmation was not recognised. Please make sure to use the full web address as mentioned in the email that you received. Sometimes this web address wraps onto multiple lines.\n";
}
This now allows me to have several lists available on my custom subscribe page and display a dynamic custom confirm page. Just need to add addititional nested if statements within the success if statement for each additional list id that you wish to echo to the confirm page.
Has there been any success with the custom unsubscribe and preference pages?
Regards
Spiro