SOLVED

Token for year?

Go to solution
Geoff_Krajeski1
Level 10 - Champion Alumni

Re: Token for year?

Kim Gandy

I have yet to experience an issue. 

However, I think there was one noted on the "View as webpage".

Can't recall the resolution specifically though...

Kim_Gandy1
Level 7

Re: Token for year?

To clarify, you experienced an issue on emails using "view as webpage"?

Geoff Krajeski​, can I run a scenario by you? Depending on the campaign, my team is cloning programs/emails or creating new. I know they won't remember to add script to each new program, and I don't want 2016 in any emails for the new year. In order to catch every email, does it make sense to:

  1. Add script to all existing programs and input into existing emails.
  2. Change year to 2017 in email templates in Design Studio. This would catch new program/email when user forgets to add script to new program.

I'm sure I'm overthinking this, but let me know what you think.

SanfordWhiteman
Level 10 - Community Moderator

Re: Token for year?

Kim, Velocity output in Web Page view has been irregular across instances. I wrote a well-warranted blog post about it -- only to have it be "fixed" in my primary instance within the next month. However, I haven't seen it regress in any instances once it got fixed, and according to Mkto engineering, it is expected to work (I assume there was a module loading order/omission problem on the instances that had the prob.

Anonymous
Not applicable

Re: Token for year?

We have set up a bunch of inherited tokens for such things. Dates, Year, months, regionalised addresses. They'll trickle down and be available in all programs.

Geoff_Krajeski1
Level 10 - Champion Alumni

Re: Token for year?

Yes, with the addition of global tokens (inherited) that would be the way to go!

Anonymous
Not applicable

Re: Token for year?

I know I'm a bit late to the conversation, but $date.get('yyyy') works if added to the global footer HTML and Text fields under 'Admin > Email.'  That's one option of not having to update tons of assets and programs.

Tim_Askerov
Level 1

Re: Token for year?

This seems to have stopped working for me. Anyone else experience this?

Casey_Grimes
Level 10

Re: Token for year?

The New Year is Coming. Don't be "That Company" – Update Your Date!

#set($timeZoneObject = $date.getCalendar().getTimeZone())

$date.format("yyyy", $date.getDate(), $date.getLocale(), $timeZoneObject.getTimeZone("EST"))

Anonymous
Not applicable

Re: Token for year?

I just started using this script to get the date but suddenly realized it does not work when you click the "view this email as a webpage" link. I literally see the code.

Can someone else please verify this? Thank you

SanfordWhiteman
Level 10 - Community Moderator

Re: Token for year?

Open a Support case. Some instances don't execute Velocity in Web Page View due to a configuration error. Once fixed on the back end it'll be fine.