Author Topic: Message code with empty value  (Read 1464 times)

mdm

  • Posts: 21
    • View Profile
Message code with empty value
« on: June 25, 2005, 10:32:47 am »
Hoping to save some time by asking instead of testing this myself.

I want to ask for First Name, but not require it.

So when sending email, I need to drop in some default value if first name is blank.

Like this -

To: Anonymous


In the Edit Message Code field I see this

    No first name output (optional)

Can I put Anonymous in there, and have that value come out when the First Name field is blank.

I did not find this field documented anywhere.

Thanks in advance.

mark

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Message code with empty value
« Reply #1 on: June 25, 2005, 01:07:43 pm »
Mark,

Yes, you simply place "Anonymous" under "No first name output (optional)".

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

mdm

  • Posts: 21
    • View Profile
Message code with empty value
« Reply #2 on: June 26, 2005, 02:06:04 pm »
Dean

Thank you very much, as that is the answer I wanted to hear :-)

Next question.

How about if I put another message code in that field.

For example, I want their email address to appear if first name is blank.

Can I put !email (or whatever the exact message code is).

If not, please consider that as a feature request.

Thank you.

mark

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Message code with empty value
« Reply #3 on: June 26, 2005, 04:09:31 pm »
ListMail can do this type of thing to a degree, within link codes and custom text codes, but it hasn't been implemented into name message codes.

You might try a direct modification to admin.php

Search for this around line 680 or so:

Code: [Select]
    case 'fname' :
      if(!$fname && $data1) $fname = $data1;


and make it this:

Code: [Select]
    case 'fname' :
      if(!$fname && $data1) $fname = processmsg($usid,$data1);


Now, just enter your desired codes into the "default" name for your First Name message code.

Note that this modification would need to be performed every time you update your ListMail files..  Perhaps I will put in a check for exclamation points and run the message code processmsg() function on the data if one or more is found.

Let me know how it turns out. :)

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