> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/tasks/contract-expiry-reminders.md).

# Send reminders for contracts expiring within 30 days with Duaer

In Duaer, read the contract register daily, find contracts expiring within 30 days, and email each owner a reminder.
## Build the reminder in Duaer

1. Add [Schedule Trigger](/build/schedule-trigger.md): Trigger Interval Days, Trigger at Hour 9am.
2. Add [Google Sheets](/build/google-sheets.md) with Get Row(s) on the contract register. It needs Contract, Customer, Expires, and Owner email columns, with dates like 2026-12-31.
3. Add [Filter](/build/filter.md) with both conditions: {{ $json.Expires }} date is after {{ $now.startOf("day").toISO() }}, and {{ $json.Expires }} date is before {{ $now.plus({ days: 30 }).toISO() }}.
4. Add [Send Email](/build/send-email.md): To Email {{ $json["Owner email"] }}, Subject Contract expiring: {{ $json.Contract }}, Text The contract with {{ $json.Customer }} expires on {{ $json.Expires }}. Please arrange renewal. One email per contract.
5. Publish the digital organization.

## Stop daily repeats

- Remind only at 30, 7, and 1 days: use one boolean Filter condition, {{ [30, 7, 1].includes(Math.round(DateTime.fromISO($json.Expires).diff($now.startOf("day"), "days").days)) }} is true.
- Log it: after Send Email, add Google Sheets Update Row to write a Reminded on date, and exclude rows reminded today in Filter.
- For dates like 12/31/2026, use DateTime.fromFormat($json.Expires, "M/d/yyyy"). Refer to [Work with dates using Luxon in Duaer](/code/cookbook/luxon.md).
## Questions

### Can the Duaer contract register be an Excel file?

Yes. Replace Google Sheets in the Duaer flow with a file read plus Extract from File. Filter and email stay the same.

### Can Duaer post the reminder to a chat group instead of email?

Yes. Swap Duaer Send Email for the WeCom node, or HTTP Request to a Feishu or DingTalk robot.

## Related

- [Run a Duaer digital organization on a schedule](https://doc.duaer.com/build/schedule-trigger.md)
- [Filter items in Duaer](https://doc.duaer.com/build/filter.md)
- [Send mail with Send Email in Duaer](https://doc.duaer.com/build/send-email.md)
- [Work with dates using Luxon in Duaer](https://doc.duaer.com/code/cookbook/luxon.md)

