Notifications
Announcements
Hello Friends,
Please I need to be able to automatically send birthday and anniversary mails to my contacts.Kindly help me on how to go about this.Thanks.
*This post is locked for comments
Hi Felix,
This is a frequent question and there are a lot of answers, but none of them are very good. CRM doesn't really support scheduled workflows, so all the answers out there use some hackey self-referencing workflow or kick it off using a bulk delete job, which can be scheduled. The self referencing workflow is fragile because if one fails there's nothing to kick off the next one.
What you'd need to do is set up a workflow like this:
Step 1: If Next Birthday is null, set a field for Next Birthday. That would be the next time the workflow runs.
Step 2: Wait until workflow execution time > Next Birthday. This puts the workflow to sleep until the anniversary date.
Step 3: Set Next Birthday to Next Birthday + 1 year
Step 4: Send the email
Step 5: Start a new Workflow (this one).
Now your workflow will be asleep until next year and then kick off again. Like I said, it's pretty hackey. You'll also need one instance per contact, so that could get to be a really high number as well.
This is how the CRM team suggested it on this blog. That post is eight years old and there's still not a better way to do it, in CRM.
blogs.msdn.microsoft.com/.../part-1-happy-birthday-via-workflow-using-client-side-scripting
The way I prefer doing it is using a scheduled process outside of CRM and sending the emails through code. It's more work to set up but it's much more reliable than workflow.
Hope this helps! I'd appreciate if you'd mark this as Answering your question.
Thanks,
Aiden
Thanks Aiden,
I followed the link in your response but got the error message below while selecting the birthday date on my new contact.
One of the scripts for this record has caused an error. For more details, download the log file.ReferenceError: birthday is not defined at eval (eval at RunHandlerInternal (lotusbetaanalytics.crm4.dynamics.com/.../ClientApiWrapper.aspx), <anonymous>:1:1)
Thanks.
Have you referred the links below?
blog.clickdimensions.com/.../creating-automated-and-personalized-birthday-emails.html
Please convert the script to crm 2015 version. the script in above link is compatible for crm 4.0.
var birthdate = Xrm.Page.getAttribute("birthdate").getValue(); if (birthdate == null) { Xrm.Page.getAttribute("new_upcomingbirthday").getValue()= null; return; } var today = new Date(); today.setHours(0); today.setMinutes(0); today.setSeconds(0); birthdate.setFullYear(today.getFullYear()); Xrm.Page.getAttribute("new_upcomingbirthday").setValue(birthdate);
Hello Ahktar,
Thanks for the post.
I was prompted to fill the function field in the screen shot shown below . Anything I fill in comes out as an error on my contact form. Please,what do you advice.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2