Author Topic: Is it possible to expand includes in HTML messages?  (Read 1367 times)

miked1

  • Posts: 3
    • View Profile
Is it possible to expand includes in HTML messages?
« on: June 08, 2006, 08:38:02 am »
I would like to expand out information from a PHP script that is dynamically pulled in for followup HTML messages. Is there a way to do this- like modifying the .htaccess file or something inside the listmail script itself?
Thanks,
Mike

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Is it possible to expand includes in HTML messages?
« Reply #1 on: June 08, 2006, 10:54:21 am »
I think this could be solved with a recently suggested feature.  A user requested the ability to specify a URL to load and use as the HTML for your message.  This isn't available yet, but is coming.  For now, I've managed to hack something together for my new site.  the file "signup-xtra.php" will be included on signup if you create it in your main ListMail folder.  I've set mine up as follows:
Code: [Select]
<?php/*-------------------------------------------------------------------------------  ListMail signup-xtra.php  This file will run after a successful confirmation in confirm.php and after a successful signup in signup.php  Modify the file and copy it to your MAIN ListMail dir.  It will not be overwritten by updates!  Place custom commands below, ListMail database link is already in effect as $link, if you need to access another database, use $link2.  Available variables are taken directly from the signup insert command run just before this script is included.  $uid - User's 6 character unique string.  $list - List subscribed to.  $fname - First name, if available.  $lname - Last name, if available.  $email - User's email address.  $user1 $user2 $user3 $user4 $user5 $user6 $user7 $user8 $user9 $user10 - Custom field information.  $html - User's Text/HTML or text-only setting, will be '1' or '0'.  $userseq - User sequence # from first followup, if exists. Will be '1' if not.  $userdel - User delay # from first followup, if exists.  $confirmed - This will always be '1', as we run this script only after a successful signup/confirm.  $today - The date, Y-m-d ie. 2002-01-30  $ipaddr - User's IP address, if available.  $refurl - User's Referring URL, if available.  NOTE: This script will run after every non-manual signup to every list.  When manually adding, the script can be run optionally.  It is recommended you perform your own list checking to make sure your custom commands run correctly.  ie:  if($list=='1'){  commands(); exit; }-------------------------------------------------------------------------------*//* // MYSQL CONNECT EXAMPLE $sql2u = 'USERNAME'; $sql2p = 'PASSWORD'; $sql2d = 'DATABASE'; $link2 = mysql_connect('localhost',$sql2u,$sql2p) or die('could not connect'); mysql_select_db($sql2d,$link2); // query example // listmail DB // mysql_query("select id from lm_users where 1",$link); // xtra DB // mysql_query("select id from yourtable where 1",$link2);*/// CUSTOM SCRIPT HERE/* CLIENTDEMO */if($list=='1'){	$page = file_get_contents("http://example.com/tour/clientdemo");	$mystr0 = '<!-- LMP-CHTML-START -->';	$mystr1 = '<!-- LMP-CHTML-END -->';	$sp0 = strpos($page,$mystr0);	$sp1 = strpos($page,$mystr1);	// remove string in between	$leng = strlen($page)-((strlen($page)-$sp1)+$sp0)+strlen($mystr1);	$chunk = substr($page,$sp0,$leng);	$page = str_replace($chunk,"Thanks for subscribing, $fname!<br><br>Date: <b>".date("l, F jS, Y")."</b><img src=/i/1.gif width=10><br>Time: <b>".date("g:ia T")."</b><br><br>Email address: <b>$email</b><br>Referring URL: <b>$refurl</b><br>IP Address: <b>$ipaddr</b><br><br>The page you are looking at right now is not actually loaded from our site in the usual fashion - it's set up in <span class=lmp>ListMailPRO</span>!  That's right, you can output <i>your</i> own <i>personalized</i> HTML during subscription and removal complete with dynamic user data, custom formatted dates, tracked links, and more!  Likewise, error messages are customizable and can be inserted easily, wherever you like.<br><br><center><div style=\"border: 1px dotted navy; padding: 5px 5px 5px 5px; width: 550px\">Please <span class=normred>check your email now</span> to see an example <i>welcome message</i> sent by <span class=lmp>ListMailPRO</span>.<br></div></center><br>The next stop on the ListMail tour is, perhaps, the most exciting - the <a class=normlink href=/tour/admindemo>Administrator Demo</a>!",$page);	echo $page;	exit;}// END?>

Maybe it will help ;)

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting