Is there any way to get the system YEAR in a token?
This is in reference to the copyright date in each of our fulfillment emails.
Rather than having to update hundreds of of FEs each year in January, I would proper and ask if it is possible to get a token for something like {{system.dateYear}}.
Solved! Go to Solution.
This seems to have stopped working for me. Anyone else experience this?
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"))
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
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.
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.
Hi Geoffrey,
A velocity script should be able to do this easily. See http://developers.marketo.com/documentation/velocity-script/
-Greg
Thanks Grégoire Michel, I will have to take a look at that!
This works like a charm!
$date.get('yyyy')
Hi Geoff Krajeski, how do I input this code into the required token field? When I just copy/paste, it errors. Thanks!
It is not a token field. This is velocity scripting Kim Gandy. You just add it to your email or template.
It's been working just fine for me and the team at PR Newswire.
If you need further Velocity knowledge you can look here: http://developers.marketo.com/email-scripting/
I have not yet experienced the potential issues Sandy describes above, but will be interested to see come the flip of the year.
Is there any way to create this on a system level? Adding script to each program would be very time consuming.
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.
Yes, with the addition of global tokens (inherited) that would be the way to go!
It unfortunately is a time consuming process (but great for holiday week work LOL).
My recommendation is to create a snippet (honestly) so that the redundancy is one-fold, and you only need to change in one place!
I am still dealing with this in a super large instance with 450+ programs to handle.
Haha, true about holiday work week.
I was able to add this successfully for two programs, but two others became a complete cluster upon adding. Have you ever had trouble with approving email assets after adding this script to email templates? Support "worked" on this all morning, but still never came up with an answer.
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...
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:
I'm sure I'm overthinking this, but let me know what you think.
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.
Careful with timezones. I know it sounds crazy, but unless you know the input and output timezones are the same (not necessarily the case on your Marketo pod/instance) even when only using the YYYY part, you'll be out of alignment for a few of hours around the turn of the year.
Ordinarily, that small period over the whole year isn't a big deal (compared to the regular problems you'll encounter if using full days and times) but since you're specifically using this to roll over into the New Year, if someone double-checks while they're watching the Big Ball drop, they may think it's broken.