Use of Email Templates

I want to create email templates with almost all the info in the template filled by default.
For example I don’t know if there is the possibilty to fill the subject with purchase number automatically. When no template is created, for default the subject is filled with the model rec_name but not when a template is used.
Furthermore, I would like to fill the recipients field with some email “hardcoded” because there are some mails that always are wanted to be send to the same email group. Also I would like to call fields of the model in the message part.
AFAIK I can create a field in the configuration setting the emails, and a function field on the model to return that information. But I would prefer a better way to do it.
Thanks beforehand!

1 Like

The subject field is a template just like the body.

If you do not select fields but fill the char field which accept any PYSON expression, you can set it for a fixes string.

So in the subject and the body there is no way to call fields?

No, both fields are Genshi text based with the record in the context.

I tried to do {{ record.<variable_name> }} in the body, but that doesn’t work. Am I doing something wrong, or I have to initialize the record variable somewhere?

The syntax is ${record.rec_name}, see Documentation/templates.html – Genshi

Perfect. Thanks a a lot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.