Custom token referenced in another token | Community
Skip to main content
June 19, 2016
Solved

Custom token referenced in another token

  • June 19, 2016
  • 2 replies
  • 2937 views

Hello Marketo community,

I built a custom token named {{my.Prior Month MMMM}} in my active marketing campaigns folder that reads:

#set($calendar = $date.getCalendar())  

$date.format('MMMM',$calendar)

This populates in email copy successfully when referenced, e.g. "June", "May", etc.

I'm trying to reference this token with a custom token named {{my.PNGreetingSurpluskWhvsOnTrack}} in a program that is nested within the active marketing campaigns folder. When I include it in the token below, it doesn't populate in an email and just displays the token name. Any recommendations would be greatly appreciated. Thanks!

Daniel

Custom token {{my.PNGreetingSurpluskWhvsOnTrack}} to be referenced in an email draft:

##check if the monitored production is > OR < estimated production

##check if the monitored production is > estimated production

#if(${lead.pNOnTrackClassification} == "100+")

  ##if the lead has more monitored production than estimated, tell them how large the surplus kWh hours were

  #set($my.PNGreetingSurpluskWhvsOnTrack = "Your system produced ${lead.pNMonitoredvsEstimatedSurpluskWh} kWh more than we forecasted in {my.Prior Month MMMM}!*")

##check if the monitored production is < estimated production

#else

  ##if the lead has less monitored production than estimated, tell them they are on track

  #set($my.PNGreetingSurpluskWhvsOnTrack = "Your system's {{my.Prior Month MMMM}} production was right on track with forecasted production!*")

#end

${my.PNGreetingSurpluskWhvsOnTrack}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Grégoire_Miche2

Hi Daniel,

I do not think it would work either. But the workaround is easy and you can set and use you $calendar variable in the second token.

-Greg

2 replies

Grégoire_Miche2
Grégoire_Miche2Accepted solution
New Participant
June 19, 2016

Hi Daniel,

I do not think it would work either. But the workaround is easy and you can set and use you $calendar variable in the second token.

-Greg

June 19, 2016

Thanks for replying, Jamie and Gregoire.

I successfully tested the following. Thanks you both for you help!

##Get prior calendar month

#set($calendar = $date.getCalendar()) 

$calendar.add(2,-1)

#set($priorMonth = $date.format('MMMM',$calendar))

##check if the monitored production is > OR < estimated production

##check if the monitored production is > estimated production

#if(${lead.pNOnTrackClassification} == "100+")

  ##if the lead has more monitored production than estimated, tell them how large the surplus kWh hours were

  #set($my.PNGreetingSurpluskWhvsOnTrack = "Your system produced ${lead.pNMonitoredvsEstimatedSurpluskWh} kWh more than we forecasted in $priorMonth!*")

##check if the monitored production is < estimated production

#else

  ##if the lead has less monitored production than estimated, tell them they are on track

  #set($my.PNGreetingSurpluskWhvsOnTrack = "Your system's $priorMonth production was right on track with forecasted production!*")

#end

${my.PNGreetingSurpluskWhvsOnTrack}

Grégoire_Miche2
New Participant
June 19, 2016

That's it

June 19, 2016

I have tried this before myself and I do not think it will work, unfortunately