Forum Discussion

syafiq's avatar
6 years ago

How to display current date in the email notification

Hello There,

I'm trying to customize our email subscription notification in the studio text editor by displaying the current date..but failed..so far i inserted

${.now?string.long}  - it display the code itself not the date
$date - display the code
${date.getCurrentDate("yyyy", $locale)}  - display code too  ðŸ˜“

can someone help me to do it the right way.thank 

Khoros Communities  

 

 

 

  • syafiq - Haven't found much on the community, but if you go to studio, in Text Editor > Email Text and open any email template, down below you will see the available API reference. They basically use Velocity scripting, so it is their documentation which may be of use.

    FYI

    Email Template API Reference

    Customizing email template text and logic is generally considered an advanced task. Programming experience and a familiarity with programming languages is required. The documentation provided here is intended for developers. Non-technical users might find the Email Template Variables table useful to understand information displayed and used within the template.

    Email templates are compiled using Apache Velocity. Each template is provided with a unique context that can be accessed programmatically within the email template. See the Velocity User Guide to learn how to use the provided context in your email templates.

    Example Variable

     

    In this example, we use the top-level user object to access the nested ranking object, and finally access the getName() method using the shorthand notation: name.

    • syafiq's avatar
      syafiq
      Ace

      Thanks for the info VarunGrazitti  . I've gone thru docs in the text editor, but nothing in there mention how to display the notification date, So far there is the message post date in the docs but i want to notify the email recipient  on when is the message is last edited.

      • syafiq - Your OP said you want to get the current date in the email, this reply says the message edit date. 

        Anyhow, I would suggest talking to the Khoros support and see if there is an option to achieve what you're looking for.