How to insert current date (variable) to email templates

Hi,
Our reviewers told me that the emails sent upon completion of a review do not contain a date within the body of email message. They require this date in order to document “the date of review” during academic processes.
How can I automatically add current date to email templates as a variable?
Best Regards,
Ugur Kocak
10

Did you try to insert tags? I asked that already

Hi @vvucic,
It doesn’t matter whether it is in a variable or the tag form, all I need is to insert current date when an email is sent. When I click that pkp tag button in “thank to reviewer” email, it comes empty. Your previous question was not enough to solve my problem. I want to insert current date to all email templates, at least to the “thank to reviewer” template, because the reviewers use this mail to document their review. Do you have any suggestion?
Best regards,

I am not sure how to create/enable tags in PKP tag button in TinyMce edito. Maybe @asmecher and @bozana can give us hint for that.

Hi @vvucic,
The syntax of the pkp tag is simple enough, when I look at the source code, it is like;

span class=“pkpTag mceNonEditable” data-symbolic=“senderEmail”>Sender Email</span

span class=“pkpTag mceNonEditable” data-symbolic=“senderName”>Sender Name</span

But, I don’t know the pkp tag or variable corresponding to current date.
Regards,
15

Hi all,

To extend the list of available variables, I’d suggest looking at the _getAllowedVariables function e.g. in lib/pkp/controllers/modals/editorDecision/form/EditorDecisionWithEmailForm.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Thank you for your reply,
Although I am not sure what I did, I worked on your trip;

Into lib/pkp/locale/en_US/common.xml;

    <message key="email.dateCurrent">Date</message>

Into lib/pkp/classes/mail/MailTemplate.inc.php; after line 172 containing senderName;

  'dateCurrent' => Core::getCurrentDate(),

Into the signature in emails tab of workflow settings,

  <span class="pkpTag mceNonEditable" data-symbolic="dateCurrent">Current Date</span>

worked for me.

Now, the date is automatically inserted to the end of each email when it was sent.
Best regards,
Ugur Kocak

  • I want to mark some topics as solved, but I can’t find such an option. Is it explained somewhere in the forum documents?
    39
1 Like

Congratulations! I will bookmark your solution.