packages/twenty-docs/user-guide/workflows/how-tos/crm-automations/send-email-alerts-with-tasks-due.mdx
import { VimeoEmbed } from '/snippets/vimeo-embed.mdx';
Send daily email reminders to each team member about their tasks due today.
This workflow runs on a schedule and:
0 8 * * *Add a Code action to format the tasks into a readable list with links:
export const main = async (params: {
tasksDue?: Array<{ id: string; title: string }> | null | string;
}) => {
const tasksDue =
typeof params.tasksDue === "string"
? JSON.parse(params.tasksDue)
: params.tasksDue;
if (!Array.isArray(tasksDue) || tasksDue.length === 0) {
return {
formattedTasks: "No tasks due today."
};
}
const formattedTasks = tasksDue
.map(
t =>
`${t.title}\nhttps://yourSubDomain.twenty.com/object/task/${t.id}`
)
.join("\n\n");
return { formattedTasks };
};
| Field | Value |
|---|---|
| To | {{iterator.currentItem.userEmail}} (workspace member's email) |
| Subject | Your Tasks Due Today |
| Body | {{code.formattedTasks}} |