Forum Discussion

dhiraj_gophane's avatar
11 years ago

what we can use in email template code?

Hi,

can we use javascript in email template code?

can we do rest api calls?

can we fetch any metadata which is created at backend?

7 Replies

  • Hi

     

    The email templates use freemarker <<EDIT: They actually use Velocity >> so you are limited to what you can do however i wont claim to know too much about it because i dont :) other than everytime i play with my email templates i break them. 

     

    There are a lot of TKB and user content on here, just found this but may be a bit bsic for what you're after...

    http://community.lithium.com/t5/Developers-Knowledge-Base/Email-template-context-objects/ta-p/75924

     

    Thanks 

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)
    11 years ago
    in additional to what Fellsteruk has mentioned: you may use JavaScript with normal HTML in email body, but most of email server will block JavaScript in email body.
  • ChiaraS's avatar
    ChiaraS
    Lithium Alumni (Retired)
    11 years ago

    Note that as stated in the TKB article linked above, email templates don't use Freemarker but Velocity instead. You should be able to use the context objects listed on the page as long the velocity syntax is correct.

  • dhiraj_gophane's avatar
    dhiraj_gophane
    Leader
    11 years ago
    Guys,
    can I do rest api call in Email template?
    or can I call any community endpoint in email template code?
  • Hi,

     

    How to get the login user role information in Email Template?