[mod] Personalized Subject Line version. 2.10.4

3rd party code for phpList

Would You Like To Have Personalized Subject Lines Become A PHPList Core Function?

Yes
45
100%
No
0
No votes
I Really Don't Care
0
No votes
 
Total votes : 45

[mod] Personalized Subject Line version. 2.10.4

Postby spanglishton » 8:04am, Wed 28 Mar, 2007

s01ipsist wrote:Just for the interest of those who are now using phplist-2.10.1

The following 2 changes to sendemaillib.php will make the phplist evaluate variables in the Subject line.

1
change line
Code: Select all
if (!$mail->send("", $destinationemail, $fromname, $fromemail, $subject)) {

to
Code: Select all
$theSubject = plugAttributes($subject, $email);
if (!$mail->send("", $destinationemail, $fromname, $fromemail, $theSubject)) {


2
above the line
Code: Select all
function addAttachments($msgid,&$mail,$type) {

add following function
Code: Select all
//srs added this function, clipped from the PHPlist user forum
//replace template vars in the subject line for customization based on user attributes
function plugAttributes($str="", $email="")
{
   $custom_list=getUserAttributeValues($email);
   while (list($AttribName,$AttribValue) = each ($custom_list)) {
        foreach($custom_list AS $AttribName => $AttribValue)
                $str = trim(str_replace("[{$AttribName}]",$AttribValue,$str));
   }
   return $str;
}



Just in case someone else was looking for the answer to this question with the latest version of PHPList (2.10.4), this modification works perfectly.

I searched for this solution and tried many variations before I found this simple solution from s01ipsist. Thanks for helping out!

I'm sure someone will need this, so I figured I would try to save you from searching every post in this forum. Just use this one if you have 2.10.4. It works!

I really don't understand why this hasn't been added as a standard in PHPList since it's such an easy, needed modification. Just my two sense.

Oh, by the way, the only reason why I didn't just link to it is because I didn't want to pose any unnecessary confusion, because the topic I found this on had a lot of clutter.

But for those of you who just "Have To Know", here is a link to the topic this quote originated from:

(This is because I haven't posted 10 times yet) {h}{t}{t}{p}{:}{/}{/}forums.phplist.{c}{o}{m}/viewtopic.php?t=2259&highlight=placeholder+subject

I hope this helps someone. I know it helped me! Thanks again s01ipsist!

Spanglishton :!:
spanglishton
phpList newbie
 
Posts: 1
Joined: 7:32am, Wed 28 Mar, 2007

Postby Emily » 12:03am, Thu 05 Jul, 2007

Thank you very much for this simple solution! This should definitely be a part of the program - personalization can make a big difference in your reader's experience. Everybody who is helped by this mod, please vote above!

Emily
Emily
phpLister
 
Posts: 10
Joined: 4:23pm, Mon 13 Nov, 2006
Location: Spring Hill, FL

Postby pdblizzard » 2:11pm, Sat 21 Jul, 2007

Thank you for this modification, it works great! I voted that I agree it should be a standard feature.

Does anyone know how to make it work when someone uses the FORWARD TO A FRIEND link?
It treats the attribute [variable] as a literal in the subject line of the email and the resulting forward page where you insert the email address to be forwarded to.
pdblizzard
phpList newbie
 
Posts: 1
Joined: 6:20am, Sun 04 Feb, 2007

Postby rjc » 6:20pm, Fri 14 Sep, 2007

Worked great for me in v2.10.4. Will try v2.10.5 soon. Thanks! :D
rjc
PL Nut
 
Posts: 28
Joined: 10:57pm, Mon 11 Dec, 2006

2.10.4 no go, huh?

Postby Hajo » 2:43am, Fri 21 Sep, 2007

Man, I got really excited when I found this thread and thought it might finally give me subject attributes in phplist 2.10.4. Alas, it doesn't work on my server. :(
This really feels like twilight zone over here. How come others are successfully using this mod in 2.10.4?
I looked at permissions and opened the file to 755 permission rights, but still no go. All I get is the endless process queue with no results and no emails sent, ever. When I change sendemaillib.php back to the original file, everything returns to normal, but of course the subject lines don't understand attributes here.

Can anyone help with this? I really don't understand why it isn't working. Any help would be greatly appreciated. Having customized subject lines is crucial to ut through the load of spam and other email people are getting.

Thanks in advance,

Hajo
Hajo
phpList newbie
 
Posts: 4
Joined: 6:44pm, Thu 17 May, 2007

FYI, 2.10.5 no go

Postby Hajo » 5:41am, Fri 21 Sep, 2007

FYI, just upgraded to 2.10.5 to see what happens with this mod and it doesn't work on my server, either. Can those who are using this mod successfully with 2.10.4 (or 2.10.5) post what servers they're running it on? Version numbers etc?

Thanks,

Hajo
Hajo
phpList newbie
 
Posts: 4
Joined: 6:44pm, Thu 17 May, 2007

Postby Agustin Bravo » 8:45pm, Thu 27 Dec, 2007

You have to be careful when you use this. It is case sensitive. My name subject is "Nombre", and until I mathed the exact case, it didn't work. Hope this helps.

Agustin.
Agustin Bravo
phpList newbie
 
Posts: 1
Joined: 8:20pm, Thu 27 Dec, 2007

Versions

Postby Heritage » 3:37pm, Thu 17 Jan, 2008

I believe I have tried this on PHP 5 servers with success, but older PHP 4 versions seem to hang on the mod.

With all the new security features slash patching on servers we will be lucky of we get a fix for bounce handling and subject line customization on PHP 4 versions in the next updates past 2.10.5
Heritage
Moderator
 
Posts: 223
Joined: 3:25pm, Fri 23 Jun, 2006
Location: 800 720-7301

Cant seem to get the custom subject line to work

Postby driller » 9:30pm, Sun 20 Jan, 2008

I updated the sendemaillib.php according to spanglishton's post and the custom subject line doesn't seem to work still. I did test the same attributes that work in the body of the email into the subject and still had no luck with it.

Does anyone have any other ideas or suggestions that might make this work?

I am currently on:
version 2.10.5
PHP version 5.2.4
MySQL version 5.0.45-community

Thanks!

Chad
driller
phpList newbie
 
Posts: 3
Joined: 9:03pm, Sun 20 Jan, 2008

Postby s01ipsist » 12:54am, Tue 22 Jan, 2008

Just to confirm this hack works perfectly on 2.10.5.
I did a fresh install, made these changes and it worked fine for me.
s01ipsist
phpList newbie
 
Posts: 2
Joined: 5:46am, Tue 20 Sep, 2005

Postby Guest » 9:24pm, Wed 08 Oct, 2008

Hi all,

My first post here!

I just tried this mods on version 2.10.5 and it's working perfectly!

I don't understand why this is not part of the script by default.

By adding a personal information in the subject (like the name of your subscriber) you will get a better Open Rate of your messages!

Jason
Guest
 

Postby yorktown » 11:40pm, Thu 11 Dec, 2008

Does it work in 2.10.8? Have they added it as a permanent mod?

This mod is 'the bomb' I use it all the time.
yorktown
phpLister
 
Posts: 5
Joined: 1:46am, Tue 21 Nov, 2006

Re: [mod] Personalized Subject Line version. 2.10.4

Postby tomaszs » 10:44am, Thu 02 Aug, 2012

replace str_replace with str_ireplace so that upper-case and anyother-case attributes will be replaced. Current version showed above does not parse for example [COMPANY NAME]. With replacing with str_ireplace it does parse it correctly.
tomaszs
phpList newbie
 
Posts: 1
Joined: 10:41am, Thu 02 Aug, 2012

Re: [mod] Personalized Subject Line version. 2.10.4

Postby hsodhi » 6:54pm, Mon 20 Aug, 2012

Hi !

I am on phpList Version 2.10.17

Will this mod work on this version ? Any advice ?

It'd be great if I could get this to work ! A name in Subject is far more personal.....

Waiting ...

thanks !

hsodhi
hsodhi
phpList newbie
 
Posts: 3
Joined: 5:41pm, Sun 19 Aug, 2012

Re: [mod] Personalized Subject Line version. 2.10.4

Postby JoeTorma » 5:41am, Mon 27 Aug, 2012

hsodhi wrote:Hi !

I am on phpList Version 2.10.17

Will this mod work on this version ? Any advice ?

It'd be great if I could get this to work ! A name in Subject is far more personal.....

Waiting ...

thanks !

hsodhi



Works perfectly on 2.10.19 with the addition of

tomaszs wrote:replace str_replace with str_ireplace so that upper-case and anyother-case attributes will be replaced. Current version showed above does not parse for example [COMPANY NAME]. With replacing with str_ireplace it does parse it correctly.


Should be part of CORE along with conditionals.
JoeTorma
phpList newbie
 
Posts: 3
Joined: 1:46am, Sun 05 Aug, 2012

Next

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 1 guest