Access to user or employee on email template

In email templates it would be good to have access to the name current user or its employee. What is the right way to achieve this?

You can extend EmailTemplate.eval to add more contextual values.
But do not forget that the signature of the user already added to the email.

I am not sure if this will work. I want to use the value inside the body of the template. But only the record itself is available on generation of the TextTemplate.

I know about the signature but normally you would sign off an email like

With regards,
Mr. X

and this comes before the signature.

Indeed EmailTemplate.eval does not allow you to change the evaluation environment.
We could imagine make this extendable even if I think there are almost no case where it should be needed.

What is the point to repeat your name just above the signature ?

Its just not looking good to have a separator between the text of the email and the closing formula.
And there are a lot of people that still want to have there email correspondence look like a well written letter.

I would appreciate to have the possibility to extend the evaluation environment.

This is email not letter. They must embrace the correct format instead.

Can you point me to a source that explain that valid format?

I did some research before starting this thread and i didn’t find any reliable source describing such a valid format that is dealing with the topic that the closing of the email should be or should not be part of the signature. Currently Tryton handles the signature like a signature file from an email client and I still think that the closing of the email should not be part of such a signature file.

With a quick search I found: https://business.tutsplus.com/articles/how-to-end-a-business-email-with-a-professional-closing--cms-29097

The signature as you said is the standard way that most email client are using.

With a quick search I found this one that describes my version:

So which one is the right one? I think that there is not really a consensus on this topic.

1 Like

Most users are not aware of this convention. And often receivers are complaining about this style being unfriendly.

Indeed EmailTemplate.eval is for the PYSON expression like the recipients. It is the context of TextTemplate.generate that should be extendable.