well to make things more clear, if you only want to insert custom attributes in the body of the message, you do not need any mod of any kind. This is standard, whether using regular data such as 'email', or any other custom attribute you may want to create by yourself. Just add the name of the attribute between brackets, anywhere in a text or html message.

Thank You shumisha. I was wondering if that was the case. I will try it.

Thank You bigcashcreator. Your example might be something I will also try. It seems that future versions should have this built into the setup...That is, a way to add custom placeholders without having to go in and mess with the code.

I had a different reason to customize the subject line. I have a daily newsletter going out with repetition that pulls that day's file from a URL so each newsletter is different for each day.

With repetition, the subject line would be the same each day, and not distinctive in the list of emails.

So, I found how to make a change that sends out the newsletter with the day's date as part of the subject line. So instead of "The Newsletter", it will now say "Newletter for Friday 5 May" automatically.

The subject line in the message uses [NEWSDATE] as a placeholder for the variable date. Thus, the subject line as entered in the message is:
Newsletter for [NEWSDATE]

The date() function in PHP has a number of choices of symbols to indicate how the date will be displayed. 'l' gives the day of the week as a full word, 'j' gives the day in 1 or 2 numerals, and 'F' gives the month as a full word. Google for a manual on PHP that gives other choices.

The next line is really useful. It is used throughout several scripts wherever a placeholder is to be substituted. The third argument $subject is the string which contains the placeholder to be replaced. "\[NEWSDATE\]" is the placeholder, with '\' used to indicate the '[' is a literal and not part of code. $newsdate is the string that will be used to replace it. Simple.

The subject line in received emails has the substitution. The stored message under the queued tab or under the sent tab keeps the placeholder [NEWSDATE] as a literal.

Putting together two ideas in this forum I came up with this--will replace any attribute in the subject line as long as it is of format [MYATTRIBUTE] (all uppercase, just as in message body for PHPlist). Also it will replace [NEWSDATE] with a date of form "Monday 4 September".

This would be a great little addition to PHPlist. Another nice feature would be to be able to add the date to the message body. Yet another--allow date format to be specified.

As it stands, you can change date format by fiddling with input to "time" function below; usual PHP time formatting elements apply.

//added this function, adapted from the PHPlist user forum//replace template vars in the subject line for customization based on user attributes//should be used as upper case like [FIRST NAME] just as with attribs in body.//also can include current date using [NEWSDATE]

In the body of my emails I have tried both [First Name] which is exactly as my attribute is configured and also [FIRST NAME] but neither work. I just get an email which says Dear [FIRST NAME] or [First Name].

I had the same problem when I used spaces in my attributes....don't know why it does, but try to make an attribute w/o spaces...[firstname]. Also at the beginnig of this topic there is code you need to replace in your files...Let me know if you need help.

It looks like there are some folks here who might be able to help me with this question:

I'm using the older functionality to utilize Admin Attributes such as [listowner.attribute], which works great.

I'd like to be able to put [listowner.email] into the "from" field of the message, so that if I send the same message to a number of different lists, the "from" email address is the owner of each list.

I have been unable to get this to work as outlined above. I am trying to have the thank you page that is returned when registering be personalized with the contact name in the form, but so far have not been able to get it to work. Any ideas as to what I should be putting in there? Have tried [Contact] as that is the name of the attribute I want to use.

//added this function, adapted from the PHPlist user forum//replace template vars in the subject line for customization based on user attributes//should be used as upper case like [FIRST NAME] just as with attribs in body.//also can include current date using [NEWSDATE] //also can include list name (title) using [LISTNAME]//also can include template name using [TEMPLATENAME]function plugAttributes($str="", $email="",$messageid=0){ # Add two lines to replace the placeholder in subject line bhugh, 9/2006 $newsdate = date('l j F'); $str = eregi_replace("\[NEWSDATE\]",$newsdate,$str); #