hakana VIP
Total posts: 425
12 Jun 2019 16:31

Hello Sergey,

Is it possible to add a parameter to [NAME] palceholder like [NAME|ucwords] So that we can show hakan as Hakan. If possible I also want this modification for emails. Especially for emails.

Kind regards, Hakan

Last Modified: 17 Mar 2020


Sergey
Total posts: 13,748
13 Jun 2019 05:58

Technicaly yes possible. But logicaly why? Why would user eneter name with small leter? Most probably because he wants that way. It is not quire right to correct users on their own name.

Although it will be options, I understand.

Wheer is that placeholder. I do not see it in email.


hakana VIP
Total posts: 425
15 Jun 2019 10:03

My members are not very computer friendly. Most of them put their names with small caps but without intention, only because they can't manage it. Therefore I requested this parameter.

In the notification emails, the [NAME] placeholder turns into [USER] placeholder but they both represent the same thing.

Thank you very much for your great support.


Sergey
Total posts: 13,748
18 Jun 2019 12:20

I see now. Unfortuantely if I add some modifiers into this placeholders like [USER|ucfirst] then simple replace will turn into to compilation process. I have to parse every placeholder, check if modifiers exists and so one. That would be a very complicated process to make it bug free or security safe.

I can only suggest you how to hack.

In file components\com_emerald\helpers\emerald.php line 1085 change

$body = str_ireplace('[USER]', str_replace("\n", ' ', JFactory::getUser($subscription->user_id)->name), $body);

to

$body = str_ireplace('[USER]', str_replace("\n", ' ', ucfirst(JFactory::getUser($subscription->user_id)->name)), $body);
Powered by Cobalt