Skip to content
Quenza
MCPNew: use this help center in Claude, ChatGPT or CursorConnect →

Weekly task digest

2 min read

Send every team member their open Quenza tasks each Monday, overdue and due this week, to Slack or by email, in JavaScript, Python or PHP.

Tasks are easy to forget when nobody looks at the task list. A short message every Monday morning helps: each member of the team sees what is overdue, what is due this week and for which client.

At Bright Path Coaching, Sarah Bennett and Daniel Weber get a Slack message at 8:00 every Monday. Daniel’s says that the intake call notes for Emma Clarke are two days overdue and that he wanted to send Lucas Meyer his reading list by Thursday.

The script comes in JavaScript (Node.js 18 or later), Python (with requests) and PHP (with Guzzle, composer require guzzlehttp/guzzle); pick your language in the tabs. It posts to a Slack incoming webhook. Swap the last step for an email if your team does not use Slack.

  1. List the members of the workspace.
  2. For each active member, list their tasks with assignee_type=professional and their ID.
  3. Keep the open tasks that are overdue or due in the next seven days.
  4. Send each member their list.
const API = 'https://developers.quenza.com/v1';
const headers = { Authorization: `Bearer ${process.env.QUENZA_API_TOKEN}`, Accept: 'application/json' };
// Reads every page of a list (see Pagination).
async function all(path, query = {}) {
const records = [];
let url = `${API}/${path}?${new URLSearchParams({ ...query, limit: 100 })}`;
while (url) {
const response = await fetch(url, { headers });
if (!response.ok) throw new Error(`Quenza API error ${response.status}`);
const page = await response.json();
records.push(...page.data);
url = page.links.next;
}
return records;
}
async function sendDigest(member, lines) {
await fetch(process.env.SLACK_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: `Good morning ${member.first_name}, your open tasks this week:\n${lines.join('\n')}` }),
});
}
// Client names by ID, so the digest can say who a task is about.
const clients = new Map((await all('clients')).map((c) => [c.id, c]));
const now = new Date();
const weekEnd = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000);
const day = (date) => date.toLocaleDateString('en-GB', { weekday: 'short', day: 'numeric', month: 'short' });
for (const member of await all('members')) {
if (member.status !== 'active') continue;
const tasks = await all('tasks', { assignee_type: 'professional', assignee_id: member.id });
const lines = tasks
.filter((task) => !task.is_completed && task.due_at && new Date(task.due_at) <= weekEnd)
.map((task) => {
const due = new Date(task.due_at);
const client = clients.get(task.client_id);
const icon = due < now ? ':red_circle:' : ':large_yellow_circle:';
return `${icon} ${task.title}${client ? ` for ${client.first_name} ${client.last_name}` : ''} (due ${day(due)})`;
});
if (lines.length) await sendDigest(member, lines);
}

Tasks without a due date are left out; add them as a separate “No due date” list if your team uses them a lot.

Run the script with cron, a scheduled job on your hosting, or a scheduled workflow in GitHub Actions. This cron line runs it at 8:00 every Monday:

0 8 * * 1 cd /path/to/digest && node task-digest.mjs
  • One message per person: Slack incoming webhooks post to one channel. To message each member directly, look them up by email with Slack’s API, or send an email to the member’s email instead.
  • Client tasks too: tasks a client has to do have assignee_type client. List them with assignee_type=client and a client’s ID to remind the coach which clients still have homework open.
  • Done last week: keep tasks with a completed_at in the last seven days and add a line such as “12 tasks completed last week” to keep the mood up.

Tasks explains tasks in the app.

Enlarged screenshot from this article