1b.app
Link copied -

Sending letters

There was such a problem. It is necessary to select a substring from a variable containing a string, on a template for sending messages by mail. {|$managername|} in particular from this variable. On attempts to apply any functions of the PHP language, it swears that the variable is incorrect. I even tried to simply display the length of the string, {|strlen($managername)|}, to check if any code on the template works, it still swears. So I can’t figure out how to extract the manager’s name from the {|$managername|} variable containing the full name
Original question is available on version: ru

Answers:

PHP functions do not work in email templates, only smarty. Describe in more detail what you need to do, then it will be easier to direct in the right direction.
For example: I have a manager Ivanov Ivan, I want his name to be sent in the letter as IVANOV IVAN.
26.04.2023, 18:42
Original comment available on version: ru

Гайдаров Руслан Ісмаілович
Leave a message in this thread and the user's contacts will be shown to you
For example, there is a variable {|$managername|}; it contains a full name, let's say Ivanov Ivan Ivanovich. There is no variable for the process manager that outputs only the name. How can I make it to display only the name Ivan in the message template?
27.04.2023, 09:30
Original comment available on version: ru

In theory, you can use smarty variables to cut off the string on the left and right by spaces 2 times, but this is tedious and not obvious. Let's make a separate variable that will display only the Manager's Name instead of the Full Name. Takes 1 hour.
27.04.2023, 11:17
Original comment available on version: ru

Гайдаров Руслан Ісмаілович
Leave a message in this thread and the user's contacts will be shown to you
We will consult with the authorities and decide
27.04.2023, 12:25
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment