Formula script Variables in templates

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • rabii
    commented on 's reply
    even on subsequent runs it will still work. the system will always replace the placeholder from content passed through the variable in the script.

  • LOG_Talent
    replied
    Hi yuri,

    I have the same question as Maarten and a follow-up question to your answer. I understand the way you described it like this: in an email template, I create placeholders, for example in the form $$id1, then I use record\attribute and string\replace to replace my placeholders with the desired values. Finally, I save my changes using record\update

    This works for the first run, but what happens on the second run, since, as I understand it, all the original placeholders have been replaced with values? Or am I missing something?

    Thanks for your support!

    Michel

    Leave a comment:


  • yuri
    replied
    Hi Maarten,

    Not possible. The function does not have a parameter to pass additional key => value data.

    But you can modify the email body in the formula script.

    After you applied the template to the email, read the body from the email using record\attribute. Then replace your custom placeholders using string\replace. Then update the email record using record\update.

    Leave a comment:


  • Maarten
    started a topic Formula script Variables in templates

    Formula script Variables in templates

    Hi team,

    I know this has come back over the years: the ability to use variables in email and PDF templates.

    It is a function that I am hoping to have regularly. But it seems impossible.

    What I would like to be able to do is pass a variable from a formula to the applyTemplate: https://docs.espocrm.com/administrat...lapplytemplate.

    Having to create fields in the record for any possible variable that I want to parse in the template is just cumbersome. It creates a lot of extra fields that I don't otherwise need in the record.

    Or am I overlooking a possibility to do this?

    Regards,

    Maarten
Working...