Building a birthday / anniversary email without using Wait Step > Next Anniversary | Community
Skip to main content
Level 4
January 22, 2022
Solved

Building a birthday / anniversary email without using Wait Step > Next Anniversary

  • January 22, 2022
  • 1 reply
  • 6578 views

Hi there, 

 

I'm aware of how to build birthday / anniversary emails using a date token in a wait flow step, as outlined here: https://experienceleague.adobe.com/docs/marketo/using/product-docs/core-marketo-concepts/smart-campaigns/flow-actions/wait/use-a-date-token-in-a-wait-flow-step.html?lang=en

 

But I would like to avoid using such a long wait step, in case there are unexpected changes in the data during that time.  We ran into this problem in a past iteration of our birthday emails - for example, an incorrect or fake Date of Birth was entered in our CRM, and then was corrected at a later date.  Since the campaign was in a wait step, the correction didn't register, and a birthday email was delivered on the wrong day.  

 

Anyone know of a way to get around this?  I basically want to do a daily batch campaign like this:

  • If the anniversary of the Date of Birth is today, then send email.  

Our IT/Systems staff (non-Marketo users) suggested this:

  • Create a new field that is the birthday anniversary for their next b-day. Then we could have a smartlist that searches to see that today is a match for that field. That field would need to be updated any time the birthday is updated or after the campaign is run. I would hope the campaign could update the anniversary field to next years date after it sends the email but I’m not sure if that’s an action that can be in the flow.

Thoughts/ideas?

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 SanfordWhiteman



@sanfordwhiteman wrote:

Then use Change Data Value to set Next Anniversary Date to {{lead.Next Anniversary Date}} + 1 year.


So if I'm understanding the portion above correctly, that takes care of ensuring the birthday campaign continues to run year after year.  


Right.

 



For the new field, should I set the field type to Date?

 

My challenge now is how to get the anniversary date in the first place.  The only field we have to work with is Date of Birth, which obviously includes the year of birth and can't be used as an anniversary.  I've seen suggestions in the forums that a webhook can be used to achieve this.  I haven't used webhooks before, so was hoping for a Marketo solution.  But hey, always fun to learn something new!  


Yep.

 


My challenge now is how to get the anniversary date in the first place.  The only field we have to work with is Date of Birth, which obviously includes the year of birth and can't be used as an anniversary.  I've seen suggestions in the forums that a webhook can be used to achieve this.  I haven't used webhooks before, so was hoping for a Marketo solution.  But hey, always fun to learn something new!  


True. If your external system can’t start it off on the right date, your challenge is to initialize the field to the first anniversary date after today, after which it’ll run automatically. There’s no way to do this with only internal Marketo functions. A webhook-compatible service can do it quite easily. For example if your service runs/understands JS, the code could be like so:

let today = new Date(); let dateOfBirth = new Date({{Lead.Date of Birth}}); var nextBirthday = new Date(dateOfBirth); nextBirthday.setYear(today.getFullYear()); if( nextBirthday < today ) { nextBirthday.setYear(nextBirthday.getFullYear() + 1); }

 

This makes a clone of the Date of Birth, then sets its year to the current year. That is, if my birthday is 2010-06-01, then the clone is 2022-06-01.  Then it does a final check to see if the clone is in the past (i.e. earlier this year) and if so, pushes it forward one more year. After that it’s good to go.

1 reply

SanfordWhiteman
Level 10
January 22, 2022

I don't like the Wait method either - no matter how common - for the reasons you note.

 

You can have a field named Next Anniversary Date and run a batch exactly as you say. Then use Change Data Value to set Next Anniversary Date to {{lead.Next Anniversary Date}} + 1 year.

Level 4
January 23, 2022

Thanks @sanfordwhiteman!  I didn't realize until today when I stumbled upon this other post with your reply that the + [timeframe]  is a possibility!!  And your application above is brilliant! 

 


@sanfordwhiteman wrote:

Then use Change Data Value to set Next Anniversary Date to {{lead.Next Anniversary Date}} + 1 year.


So if I'm understanding the portion above correctly, that takes care of ensuring the birthday campaign continues to run year after year.  

 


@sanfordwhiteman wrote:

You can have a field named Next Anniversary Date 


For the new field, should I set the field type to Date?

 

My challenge now is how to get the anniversary date in the first place.  The only field we have to work with is Date of Birth, which obviously includes the year of birth and can't be used as an anniversary.  I've seen suggestions in the forums that a webhook can be used to achieve this.  I haven't used webhooks before, so was hoping for a Marketo solution.  But hey, always fun to learn something new!  

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
January 23, 2022



@sanfordwhiteman wrote:

Then use Change Data Value to set Next Anniversary Date to {{lead.Next Anniversary Date}} + 1 year.


So if I'm understanding the portion above correctly, that takes care of ensuring the birthday campaign continues to run year after year.  


Right.

 



For the new field, should I set the field type to Date?

 

My challenge now is how to get the anniversary date in the first place.  The only field we have to work with is Date of Birth, which obviously includes the year of birth and can't be used as an anniversary.  I've seen suggestions in the forums that a webhook can be used to achieve this.  I haven't used webhooks before, so was hoping for a Marketo solution.  But hey, always fun to learn something new!  


Yep.

 


My challenge now is how to get the anniversary date in the first place.  The only field we have to work with is Date of Birth, which obviously includes the year of birth and can't be used as an anniversary.  I've seen suggestions in the forums that a webhook can be used to achieve this.  I haven't used webhooks before, so was hoping for a Marketo solution.  But hey, always fun to learn something new!  


True. If your external system can’t start it off on the right date, your challenge is to initialize the field to the first anniversary date after today, after which it’ll run automatically. There’s no way to do this with only internal Marketo functions. A webhook-compatible service can do it quite easily. For example if your service runs/understands JS, the code could be like so:

let today = new Date(); let dateOfBirth = new Date({{Lead.Date of Birth}}); var nextBirthday = new Date(dateOfBirth); nextBirthday.setYear(today.getFullYear()); if( nextBirthday < today ) { nextBirthday.setYear(nextBirthday.getFullYear() + 1); }

 

This makes a clone of the Date of Birth, then sets its year to the current year. That is, if my birthday is 2010-06-01, then the clone is 2022-06-01.  Then it does a final check to see if the clone is in the past (i.e. earlier this year) and if so, pushes it forward one more year. After that it’s good to go.