I have been trying to modify PHPList so that you can personalize the subject line as well as the body of the message.
Here is what I have tried so far, but with very little luck.
file: sendemaillib.php
Line 53:
Commented out the line
line 449:
Added a call to custom function and cast it to a variable
- Code: Select all
$theSubject=makeAttrib(stripslashes($message['subject']), $email);
line 451:
Change the last variable in the argument list from $cashed[$messageid]['subject'] to $theSubject
- Code: Select all
if (!TEST) {
if (!$mail->send("", $email, $cached[$messageid]["fromname"], $cached[$messageid]["fromemail"],$theSubject)) {
logEvent("Error sending message $messageid to $email");
}
}
line 457;
created a function called makeAttrib. This calls the function getUserAttributeValues.
getUserAttributeValues grabs the list of custom values (ie: firstname, last name, etc.)
Then makeAttribe returns the subject with the replaced values. or, at least, it is supposed to., but it doesnt. Bah!
- Code: Select all
function makeAttrib($theSubject="", $email="")
{
$custom_list=getUserAttributeValues($email);
while (list($AttribName,$AttribValue) = each ($custom_list)) {
//foreach($custom_list AS $AttribName => $AttribValue) {
$theSubject = trim(eregi_replace("\[".$AttribName."\]",$AttribValue,$theSubject));
}
return $theSubject;
}
has anyone else had luck with this? I know that there have been talks on this forum about personalizing the confirmation emails and whatnot, but I am looking for a way to personalize every email.