Email Script Question | Community
Skip to main content
Jason_Scott
Level 4
August 27, 2019
Question

Email Script Question

  • August 27, 2019
  • 2 replies
  • 3619 views

I'm looking to use an email script to set a url based on a SFDC custom object which would contain the eventdate and eventname. Below is what I'm looking to do.

For the event custom object

if the eventDate is today and eventName is conference then insert url A

if the eventDate is today and eventName is meeting then insert url B

Else insert url C

Seems so simple and I'm sure this is something that can be done but I'm not sure where to start.  Have you implemented something similar?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
August 27, 2019

You're talking about a list of CO records (it's always a list, even if it's a list of 0 or 1). 

Are you outputting every record? (Yes, this matters a lot due to the vagaries of Marketo link tracking.)

Jason_Scott
Level 4
August 27, 2019

No, not looking to output every record.  There should only be one record per day max and I'm only looking to output if the eventdate is today.

SanfordWhiteman
Level 10
August 27, 2019

"should" isn't good enough for a spec though.

Let's say you will

  • sort the list by by eventDate, descending
  • output the first record whose eventDate matches today, if such a record is present

What timezone are the eventDate values based on (yes, this too matters)?

And have you read such things as https://blog.teknkl.com/velocity-days-and-weeks/ ?

Jason_Scott
Level 4
August 28, 2019

Thanks for sharing the link, I'll take a look.  There's only on record per day max.  Timezone is eastern.