Token for date.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
when i create a template of some sort, i am precented with all the tokens available. Is there no token for to days date.

An examble would be to write the date a giftcard is send on the giftcard. I see no token for that. In pure html there is no option to insert the date before the virtual giftcard is send.

Is there a token to add a date to a template ??
5 years ago
Hi, This is still a valid question, formatting the email template to resemble a voucher or certificate really requires the ability to add additional tokens such as date so we can show when it is valid from.  Any ideas / solutions on how to achieve this for V3.90.

Cheers,
Paul
5 years ago
Are you using Source Code v3.9 ?
5 years ago
Hi,

I'm not, would prefer not to but if there is not other way then I'll go down that path.
5 years ago
Maybe you could do it with a plugin if someone could make you one for you
Other than yes to add a token showing the current date you probbaly would need to change the source code

But as an alternative "%Order.CreatedOn%" - Is the Gift card valid from when the order is placed ? granted the format is probably longer than what you want.

For Code (plugin) change

You need to edit

\Libraries\Nop.Services\Messages\MessageTokenProvider.cs

AddStoreTokens(IList<Token> tokens, Store store, EmailAccount emailAccount)

Insert code

tokens.Add(new Token("Store.DateToday", DateTime.UtcNow.ToShortDateString()));

Then use token %Store.DateToday% in the message template
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.