[SOLVED] Placeholders (variables) in Subject 3.x

3rd party code for phpList

[SOLVED] Placeholders (variables) in Subject 3.x

Postby mikcheck » 1:55pm, Mon 26 Jan, 2015

TO HAVE WORKING PLACEHOLDERS ALSO IN SUBJECT

FOR PHPLIST 3.x

IN YOUR PHPLIST FOLDER > ADMIN > sendemaillib.php

You'll find code around line 927

AFTER THIS

Code: Select all
if (!TEST) {
    if ($hash != 'forwarded' || !sizeof($forwardedby)) {
      $fromname = $cached[$messageid]["fromname"];
      $fromemail = $cached[$messageid]["fromemail"];
      $subject = $cached[$messageid]["subject"];
    } else {
      $fromname = '';
      $fromemail = $forwardedby['email'];
      $subject = $GLOBALS['strFwd'].': '.$cached[$messageid]["subject"];
    }


PASTE THIS


Code: Select all
   // MODIFICA PER VARIABILE ES: [NOME] IN OGGETTO
    if (is_array($user_att_values)) {
       foreach ($user_att_values as $att_name => $att_value) {
            if (eregi("\[".$att_name."\]",$subject,$regs)) {
              $subject = eregi_replace("\[".$att_name."\]",$att_value,$subject);
            }
       }
    }
    // FINE MODIFICA


NOW VARIABLES (PLACEHOLDERS) ARE WORKING IN SUBJECT LINE
mikcheck
phpList newbie
 
Posts: 2
Joined: 12:02pm, Mon 26 Jan, 2015

Re: [SOLVED] Placeholders (variables) in Subject 3.x

Postby Dragonrider » 3:32pm, Mon 26 Jan, 2015

If this works, remember you'll need to make this edit each time phpList is officially updated.

Sad to say, so far, this does not work for me.
My sites:- http://wharfedalefestival.co.uk, http://ilkleygardeners.org.uk, http://emergencyaid.net, http://dragonrider.co.uk
Latest phpList version is now 3.0.12 (3 February 2015) and requires a minimum of MySQL 5.0 and PHP 5.3.x
Dragonrider
Moderator
 
Posts: 3460
Joined: 6:58am, Sun 02 Jul, 2006
Location: Ilkley, West Yorkshire, United Kingdom

Re: [SOLVED] Placeholders (variables) in Subject 3.x

Postby duncanc » 11:58am, Sun 01 Feb, 2015

No need to modify the phplist code as there is already a plugin that does exactly this.

See this topic https://forums.phplist.com/viewtopic.php?f=7&t=40137.
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London


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

Who is online

Users browsing this forum: No registered users and 2 guests

cron