Can you modify the {{system.date}} token?

Anonymous
Not applicable

Can you modify the {{system.date}} token?

Can the {{system.date}} token be modified to show day of the week (Monday, Tuesday, etc) instead of the regular date format? If not, is there another way to do this?

Tags (2)
7 REPLIES 7
John_Clark1
Level 10

Re: Can you modify the {{system.date}} token?

Hi Robin,

It's not currently possible to alter that token, and there isn't another that I'm aware of that will let you enter the day of the week.

John

Anonymous
Not applicable

Re: Can you modify the {{system.date}} token?

Bummer! But thank you

Anonymous
Not applicable

Re: Can you modify the {{system.date}} token?

Hi Robin,

What are you trying to do with the date token?  For instance I have a "script" token at the top of all our email newsletters with the below code which will populate the text "The Drum on Saturday" when it is sent on a Saturday, Sunday for Sundays and then just "Good Morning" for weekdays.

#set ( $day = $date.format('EEEE', ${convert.parseDate($date.full_date, 'EEE, MMMM dd, yyyy')}) )

#if ( $day.startsWith("Sat") )

    The Drum on Saturday

#elseif ( $day.startsWith("Sun") )

    The Drum on Sunday

#else    ##any other leads that don't match

    Good Morning

#end

Anonymous
Not applicable

Re: Can you modify the {{system.date}} token?

Simon thank you! That seems like it would work for us. These are html "pro-tip" emails that go to users of our mobile apps, so we'd be saying something like "that's not what you want on a Monday... ." I'm not the most technical, so just a little clarification: would I use that script in the html of the email? I can add it using the html editor? Thank you again!

Nicholas_Manojl
Level 9

Re: Can you modify the {{system.date}} token?

You add the script as a token (there is an email script option).

Then in your email you can reference it my just putting {{my.scriptName}}.

Anonymous
Not applicable

Re: Can you modify the {{system.date}} token?

Hi Robin,

Just backing up what Nicholas has included for you.  When you set up an email you have the option to create tokens which you can then use to insert data you choose into the email (like the date above).  What you need to do is create the token "outside" the email, when you do this you give it some code which you then use in the email.  Although I can do this, Marketo explain it well if you follow this link: https://docs.marketo.com/display/public/DOCS/Understanding+My+Tokens+in+a+Program​, at the bottom of the page the process continues and there is quite a good walk through to set up a token.

Anonymous
Not applicable

Re: Can you modify the {{system.date}} token?

Many thanks!