Mailing Campaign
Asked by Ezequiel Namios:

```
Hello community, I need to tie automatic mailing according to calendar records. 

For example: on May 1, is a client's birthday and I want a personalized greeting 
to be sent automatically on that date.Do you know any way to do it?

Thanks for the help
```


Answers:
author: Earl McCutcheon
body: Hello [@Ezequiel Namios](/t5/user/viewprofilepage/user-id/2103209) ,

Thanks for reaching out, and if you have Confluence and Jira set up there is a feature in Confluence called [Team Calendars](https://support.atlassian.com/confluence-cloud/docs/use-team-calendars-for-confluence/) that has this functionality baked in with [standard event types](https://support.atlassian.com/confluence-cloud/docs/see-standard-event-types/) including a Birthday list, that you can tie to [reminder emails](https://support.atlassian.com/confluence-cloud/docs/add-jira-events/) for the events to be sent out based on the calendar item.

If you do not have confluence configured this could be done with Automation for Jira, you would need to set up a Jira issue for each client that has the specific b-day set for the user in your custom field and configure a [trigger event](https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/) that will use a JQL filter based on your date field, and for all tickets that are in results would trigger a [Send Email](https://support.atlassian.com/jira-software-cloud/docs/automation-actions/#Automationactions-Sendemail) action. The only issue I see with this is trying to set up a JQL that would capture issues for a future date based on a past date. For example, the customer's Birthday is in the past 5-1-XXXX but you want the email to send on a different year 5-1-YYYY, a basic JQL looking at the date field will be looking for the specific year as well as month and day.

I played around with the settings a bit and using an advanced compare variable using [date and time SmartValues](https://support.atlassian.com/jira-software-cloud/docs/use-smart-values-to-manipulate-and-format-dates/) to convert the now date and the birthday variables into a Month and day format "MM dd" in the following format noting the custom field I used for my custom date was named "datepicker1" that you would want to replace with the clients birthday field:

```
{{issue.datepicker1.as("MM dd")}}
```

Equals  

```
{{now.as("MM dd")}}
```

the rule is set up like the following for testing:

![Screen Shot 2021-07-22 at 2.22.34 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/152455iA07D7B25FCCF1868/image-size/large?v=v2&px=999 "Screen Shot 2021-07-22 at 2.22.34 PM.png")

Do Note that I was only adding the comment to the issue to verify the date variable output was correct, and the user that is receiving the birthday request would need to be set as the reporter of the issue that contained their birthday details in the custom field.

So the use case in this scenario would be 1 issue per customer, where the customer is set as the reporter of the issue. Where the issue contains the user's birthday info, or any other specific info that you wanted to use for various reminders or email campaigns. Then the only change really needed is additional customizations for the trigger or additional filtering, I would recommend switching the trigger out for a [Schedule trigger](https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/#Automationtriggers-Scheduled) event to run once daily, to search for the issue via the advanced compare that has a date that aligns with the current day of the month and email a custom message.

I recommend checking out the various [smart value options](https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/) to customize the messaging further for the email output.

Hope this helps and is what you are looking for.

Regards,  
Earl


Tags: cloud