1
alain01
(More ?) Useful Tags in User Message Manager
  • 2020/1/26 11:43

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Hi,
For the User Message Manager (page /modules/system/admin.php?fct=mailusers),
i noticed this :
Quote:
{X_UID} will print user id
{X_UNAME} will print user name
{X_UEMAIL} will print user email
{X_UACTLINK} will print user activation link
Is there another tags (in 2.5.10 / 2.5.111) ?
I'm thinking in particular of smarty variables.
Quote:
'uname|name|email|user_avatar|url|user_icq|user_aim|user_yim|user_msnm|posts|user_from|user_occ|user_intrest|bio|user_sig'
For mail, if the name is not empty, the name is more relevant than the user name.
If we can use these variables, is it possible to write smarty tests in the message?
like :
<{if $member_info.name}>
    <{
$member_info.name}>
<{else}>
    <{
$member_info.uname}>
<{/if}>

2
Mamba
Re: (More ?) Useful Tags in User Message Manager
  • 2020/1/26 22:27

  • Mamba

  • Moderator

  • Posts: 11256

  • Since: 2004/4/23


There are also few extra:
{X_ADMINMAIL}
{
X_SITENAME}
{
X_SITEURL}
{
X_ITEM_TYPE
{
X_ITEM_NAME}
{
X_ITEM_TITLE}
{
X_ITEM_URL}
{
X_MODULE}
{
X_COMMENT_URL}
{
X_UNSUBSCRIBE_URL}
{
X_NOTIFY_EVENT}
{
CATEGORY_TITLE}
{
EVENT_SUMMARY}
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
alain01
Re: (More ?) Useful Tags in User Message Manager
  • 2020/1/26 22:42

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Thank you , i will try !
In which files can I find theses informations ?

4
alain01
Re: (More ?) Useful Tags in User Message Manager
  • 2020/1/26 23:25

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Only
{X_ADMINMAIL}, {X_SITENAME}, {X_SITEURL} work on the user message manager.

Others, no.
May be cause contextual variables.

5
Mamba
Re: (More ?) Useful Tags in User Message Manager
  • 2020/1/26 23:48

  • Mamba

  • Moderator

  • Posts: 11256

  • Since: 2004/4/23


Some of them work in the mail manager, because they are defined there, in /class/xoopsmailer.php

foreach ($this->toUsers as $user) {
            
// set some user specific variables
            
$subject str_replace('{X_UNAME}'$user->getVar('uname'), $this->subject);
            
$text    str_replace('{X_UID}'$user->getVar('uid'), $this->body);
            
$text    str_replace('{X_UEMAIL}'$user->getVar('email'), $text);
            
$text    str_replace('{X_UNAME}'$user->getVar('uname'), $text);
            
$text    str_replace('{X_UACTLINK}'XOOPS_URL '/register.php?op=actv&id=' $user->getVar('uid') . '&actkey=' $user->getVar('actkey'), $text);


You can also define them yourself in your module, as it was done, for example in SmartObject :

public static function sanitizeForCommonTags($text)
    {
        global 
$xoopsConfig;
        
$text str_replace('{X_SITENAME}'$xoopsConfig['sitename'], $text);
        
$text str_replace('{X_ADMINMAIL}'$xoopsConfig['adminmail'], $text);

        return 
$text;
    }


or in tdmspot:

$body             str_replace('{X_NAME}'$user_name$body);
            
$body             str_replace('{X_UNAME}'$user_uname$body);
            
$body             str_replace('{X_UEMAIL}'$user_email$body);
            
$body             str_replace('{X_ADMINMAIL}'$xoopsConfig['adminmail'], $body);
            
$body             str_replace('{X_SITENAME}'$xoopsConfig['sitename'], $body);
            
$body             str_replace('{X_SITEURL}'XOOPS_URL$body);
            
$tpitem['text']   = $body;
            
$meta_keywords    .= $body;
            
$meta_description .= $body;


Just search in all you modules for "{X_" and you'll find many examples of how it is done.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

6
alain01
Re: (More ?) Useful Tags in User Message Manager
  • 2020/1/27 0:39

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Haaaaa
Thank you Michael for this full anwser with examples !

I didnt know it !

7
alain01
Re: (More ?) Useful Tags in User Message Manager
  • 2021/1/5 9:30

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Strange !
Why the {X_NAME} is not present for mailing by system / e-mail users (User message manager) ?

I know that this field could be empty but we can use like :

Dear {X_UNAME}  ({X_NAME})


Do you think it's possible to add this variable on the system module ? (User message manager)

8
geekwright
Re: (More ?) Useful Tags in User Message Manager

Quote:

alain01 wrote:
Strange !
Why the {X_NAME} is not present for mailing by system / e-mail users (User message manager) ?

I know that this field could be empty but we can use like :

Dear {X_UNAME}  ({X_NAME})


Do you think it's possible to add this variable on the system module ? (User message manager)


I suspect that {X_NAME} was not included because it can be blank, so it can lead to confusing messages.

If we add it, I would suggest that we set it the same as {X_UNAME} if the name is empty. That would make it more dependable for normal use.

If that sounds useful, just open an issue for it on GitHub.

9
alain01
Re: (More ?) Useful Tags in User Message Manager
  • 2021/1/8 7:33

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Quote:

geekwright wrote:

If we add it, I would suggest that we set it the same as {X_UNAME} if the name is empty. That would make it more dependable for normal use.

If that sounds useful, just open an issue for it on GitHub.

Ok i do it !

10
alain01
Re: (More ?) Useful Tags in User Message Manager
  • 2021/1/11 14:36

  • alain01

  • Just can't stay away

  • Posts: 520

  • Since: 2003/6/20


Done !

Issue : Missed "{X_NAME}" in the User message manager #919
and Pull Request merged

Now, we could use
{X_UNAME} (login)
and a new variable, {X_NAME} (real name)

and we could use the real name, even it's empty :

{X_NAMEwill print name or uname if empty


Thank you Mage!

Login

Who's Online

72 user(s) are online (46 user(s) are browsing Support Forums)


Members: 0


Guests: 72


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits