# Exercise: Customer Anniversary Email Activity

## Requirements&#x20;

The Process will:&#x20;

* Run immediately.&#x20;
* Check the customer join date from the entity “UserName\_Acc\_customers” ([click here to see the entity creation steps](/welcome/get-started/learn-langstack/introduction-to-entities/exercise-1-customer-accounts-and-activities/customer-accounts/step-1-create-the-customers-entity.md)) and compare it to the current date.&#x20;
* If the customer join date and current date are the same, check if the anniversary email is already created in the “UserName\_Acc\_Activities” entity ([click here to see the entity creation steps](/welcome/get-started/learn-langstack/introduction-to-entities/exercise-1-customer-accounts-and-activities/customer-activities/step-1-create-the-activities-entity.md)).&#x20;
* If the customer join date and current date are the same and *an anniversary record is already created*, do not send the customer an anniversary email.&#x20;
* If the customer's join date and current date are the same and *no anniversary record is created*, send the customer an anniversary email.&#x20;
* Create a new record in the target entity “UserName\_Acc\_Activities”.&#x20;

{% hint style="info" %}
In this exercise, the actual customer anniversary email is not sent; however, all other steps, including customer email record creation, are included.
{% endhint %}

## Solution

The solution is implemented in two steps:&#x20;

* Step 1: First, traverse the records in the “UserName\_Acc\_customers” entity to check if the join date (day and month) matches the current date. Filter out customers with the matched date that may already have an anniversary email record in the “UserName\_Acc\_Activities” entity.
* Step 2: If a customer has the join date as the current date and has no anniversary record, create and store an anniversary record in the “UserName\_Acc\_Activities” entity.<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-process/exercise-customer-anniversary-email-activity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
