How to USE Administrator Attributes?

Our PHPlist has only one administrator

We created an Administrator Attributes…via menu choice Config>Config Administrator Attributes.

The attribute is company_phonenumber.

When we try to use it in a Template OR in the Content box of a campaign using either of the below methods…we get black space in the test email.

We’ve tried this:

[COMPANY_PHONENUMBER]
[LISTOWNER.COMPANY_PHONENUMBER]

The User attributes work fine, but these Administrator attributes don’t seem to work for us.

Could someone please tell me what I should be doing?

The discussion I found on this subject was from 2006 when a menu item wasn’t included.

I find documentation on HOW to ADD Administrator Attributes…just not how to USE them.

Lots of use for these attributes - address, city, etc.

Thanks in advance for suggestions!

@Phyll I’m not sure that currently admin attributes are usable. See this bug report that I raised a few years ago. https://mantis.phplist.org/view.php?id=16707
From what I can see nothing has changed, but you might want to try to use the syntax that seemed to work then.

Thank you, DuncAnc, for answering. Checked out the resource you referenced.

I tried the approach noted in

    ##LISTOWNER=1
   [LISTOWNER.NAME]

Unfortunately, it didn’t work.

Even though I added these lines (or my equivalent) in Source code method of Content editing, it put paragraph tags around the items. So, I guess code saw ##LISTOWNER=… line as html, not as a variable.

However, later on in the report you mentioned, I see the following…which indicates the capacity is NOT functioning, I presume.

   The "##LISTOWNER=1" was added in the 
   "Prepare a message" system, which is disfunctional. It was never meant 
   to be added manually by the person who is sending the campaign.

Question I’d ask would be – why put in Config > Configure Administrative Attributes in actual nicely coded menu – if you’re not going to be able to USE those attributes?

However, I appreciate your answer! It’s not horrible to hand-enter values (instead of variables) in the Content editor…just seems a pity.

I won’t pursue “discovering the secret” – if there’s no secret to discover!

@Phyll I have just been working on a proper solution for this, as described in the Mantis report. Replace admin attribute placeholders only when all the lists being sent to are owned by the same admin.

Hopefully it will be included in the next release, but if you want to modify the phplist code (just one file) then you should get a workable solution.

DuncAnc, I am willing to change the php code. Can you send me the changes that need to be made?

Will I still have problems in putting in the ##LISTOWNER=1 line without it “turning into” HTML instead of code variable?

Or do I continue to need that line?

Very interested…let me know.

You can replace the file admin/sendemaillib.php with the version here https://github.com/bramley/phplist3/blob/Mantis_16707/public_html/lists/admin/sendemaillib.php (click the Raw button to see just the code, then copy and paste ).

The ##LISTOWNER=1 is not needed as the code will use the attributes for the admin who owns the lists to which the campaign is being sent.

The placeholders are like [LISTOWNER.COMPANY_PHONENUMBER]

Okay, DunAnc, I have high hopes! I replaced the file, and didn’t see the replacement…yet.

BUT…I also note that in editing content, EVEN THOUGH I click Source button, and remove paragraph tags
around the placeholder you mention…and save…the editor is still putting those paragraph tags right back in.

Is there some “secret sauce” that will keep the paragraph tags out?

Think that’s the final step to achieving administrator attributes.

Thanks for taking the time to send me the url to the file. Sorry I didn’t implement this earlier. Whoops!

I didn’t ask which phpList version is installed, it probably needs to be the latest, 3.2.4.

But I didn’t understand your last reply. The editor will ensure that valid html is generated, so a piece of text must be within a block-level tag. But p tags surrounding a placeholder won’t affect the replacement.
Are you saying that the placeholder is not replaced?

Yes, I’m sorry, I’m having some problem.

I now understand that I can put in the placeholder within HTML. Got confused about Source, etc. because in Wordpress, I’m used to Text and Visual tabs where shortcodes must be in particular place.

I AM only seeing the TEXT of the placeholder, not seeing the replacement VALUE.

Here’s my PHP version:
PHP version: 5.4.45

Am I looking at the wrong thing?

Are there any places in the PHP file where I should put in echoes to pinpoint my problem?

BTW, I just tested again and compared the attribute spelling, etc. to what is in the template. Is the same. Get email, but value not filled in.

Also…I “lost you” in my email and that’s why this has taken so long to get back to you!

@Phyll I had not realised but the placeholder needs to be in the message content, not in the template. That’s not so useful so I will have to look at how to change that.

I must be doing something wrong…I ONLY get the placeholders on Template AND on Message Content.

Tried both places.

I don’t mean to bother you. Maybe I just need to give up on administrator Attributes. I CAN just hard-copy in the values.

I am new to PhpList, but really don’t see how else I could have put in the placeholders :}

Please don’t worry further about this.

Thanks for helping, DuncAnc! Appreciate your perserverance!