Question
Can we calculate Birthday and send email to customers in Vtiger?
Answer
Yes, you can calculate Birthday and send in Vtiger.
Let’s take a look at how user can calculate a records birthday and send an automated email with birthday wishes to that client.
In order to do so, first you have to create three more fields in addition to the default Birthday field
1- Date of birth: This fields shows the actual date of birth of the contact
2- Today – Month Date: You have to create a text type field, that will show current month and todays date
3. Birthday – Month Date: You have to create a text type field, that will show the birthday month and date
4. Is birthday today: This is a text field, whose value will be either “Yes” or “No” depending if its contacts birthdate today or not
In order to make it work, we have to set up two workflows
Workflow 1: This workflow will, update the fields (Today-Month Date, Birthday-Month Date and Is Birthday today?)
Workflow2 : This workflow will send out an automated email when the value of picklist “Is Birthday Today” is set to “Yes”, wishing them happy birthday
Configuration of Workflow 1:
Provide the details regarding Workflow Name, Description, Target Module and Status in Basic Information section
In workflow trigger, choose the time interval option for “rigger Workflow On”. Choose “Daily” in “Run Workflow field” as the workflow will execute on daily basis and determine the birthdays of the contacts. Set a time on which the workflow will be executed
Add condition according to your requirement. In this example there is no condition configured
Work Actions: In work actions, user need to configure three actions
Update Field “Today-Month Date”: Using substring expression, the value of the month and the date of today’s date will will be calculated in field “Today-Month Date”. The format of the value will be MM-DD, as the database reads the date in this format. The expression that we will use is “substring(string,start,end)”, in this example it is “substring(get_date(‘Today’),5,10)”
Note: 5, 10, specifies that character whose values will be captured, in this case it is from Character5 to Character10. For example, if today is 2022-01-01 (YYYY-MM-DD), then it will capture 01-01 (MM-DD), as we configured start as 5 and end as 10 for the string
Update field “Birthday-Month Date”: Now configure second action, use the substring expression, to determine the month and date of birthdate and update it in field “Birthday-Month Date”
Update field “Is Birthday Today?”: Compare the values of fields “Today-Month Date” with “Birthday-Month Date”. if yes then select “Yes” in “Is Birthday Today?” else “No”
Configuration of Workflow 2:
This workflow is a simpler one. This workflow will check the value of “Is Birthday Today?” field and if it is “Yes” then send an email to the contact with Birthday wishes
Fill in the Basic details
Configure the the workflow trigger based on time interval *Make sure that this workflow is executed at a later time as compared to the first workflow. As, in this example it is 10:00 AM for the second workflow and 09:00 AM for the first workflow
Configure condition. If “Is Birthday Today?” is “Yes”
Configure Actions for this workflow: Send email to the contact with Birthday Wishes
Working of the Workflows
When Birthday (month, date) and Today’s (month, date) is different
In this example the today’s date is is 05-01-2022 and the workflow one is executed
Date of Birth: Date of Birth is set to 25-01-2022
Today – Month Date: After the workflow execution that value is calculated as 01-05 as today is 05 of Jan
Birthday – Month Date: After the workflow execution that value is calculated as 01-25 as contacts birthday is 25 Jan
Is birthday today: As today is different from birthday so the value of this field is set to “No”
So in this example, todays and birthday field value were not same, that is why no email will be sent
When Birthday (month, date) and Today’s (month, date) is same
In this example the today’s date is is 05-01-2022 and the workflow one is executed
Date of Birth: Date of Birth is set to 05-01-2022
Today – Month Date: After the workflow execution that value is calculated as 01-05 as today is 05 of Jan
Birthday – Month Date: After the workflow execution that value is calculated as 01-05 as contacts birthday is 05 Jan
Is Birthday Today?: As the current date and Birthdate is same except years that is why the value of this field is set to “Yes”
So in this example, todays and birthday field values are same, that is why email is sent to the contact
Email Preview
The preview of the received email is as follows
Topic
Miscellaneous vTiger issues
How To Calculate Birthday And Send Email In Vtiger