Skip to content
v2.7

Topics and sending

Topics and subscribers, immediate, scheduled, or draft email and SMS sends, and the history with each message's status.

A topic groups the people who receive the same message. Each subscriber is a target of a project user: their email or phone. The same user can be subscribed by email and by phone. The topic shows totals per channel (email, SMS, and push).

In the console: Messaging → Topics → New topic; then, inside the topic, Subscribe, search for the user, and choose the email or the phone.

A message goes to any combination of:

  • topics: all subscribers on the message’s channel;
  • users: each user’s target on the message’s channel;
  • targets: specific targets;
  • standalone addresses (email only, in the console): people who aren’t project users.

With more than one recipient, each one receives the message without seeing the others.

Under Messaging → New email (or New SMS): subject, body in HTML or text, recipients, and, if you want, the scheduling date. The preview beside it shows the HTML in an isolated frame: scripts, forms, and links don’t work in it. The console shows how many recipients the send will count toward the daily limit.

For SMS, the counter shows the characters and how many parts the message will have: accents and emoji change the encoding and each part drops to 70 characters.

mensagens-topicos.ts (server)
import { ID, Messaging, Query, Users } from '@owbase/node';
import { client } from './client';
// Scopes: topics.read and topics.write, subscribers.write, users.read, targets.read and messages.write.
const messaging = new Messaging(client);
const users = new Users(client);
const news = await messaging.createTopic({ topicId: ID.unique(), name: 'News' });
// Each subscriber is a target (the email or the phone) of a project user.
const { users: readers } = await users.list({ queries: [Query.contains('labels', ['newsletter'])] });
for (const u of readers) {
const { targets } = await users.listTargets({ userId: u.$id });
const email = targets.find((t) => t.providerType === 'email');
if (email) await messaging.createSubscriber({ topicId: news.$id, subscriberId: ID.unique(), targetId: email.$id });
}
// Immediate send to the topic, as HTML.
const sent = await messaging.createEmail({
messageId: ID.unique(),
subject: 'New collection is here',
content: '<h1>Summer collection</h1><p>Check it out in the shop.</p>',
html: true,
topics: [news.$id],
});
// Sending is asynchronous: the status goes from processing to sent (or failed, with the reason in deliveryErrors).
const now = await messaging.getMessage({ messageId: sent.$id });
console.log(now.status, now.deliveredTotal, now.deliveryErrors);
// Scheduled: scheduledAt in UTC (12:00 UTC = 9 am in Brasília). With draft: true, it only saves the draft.
await messaging.createEmail({
messageId: ID.unique(),
subject: 'Live tomorrow',
content: 'The live stream starts at 9 am.',
topics: [news.$id],
scheduledAt: '2026-11-03T12:00:00.000Z',
});
  • Scheduled: through the API, scheduledAt in ISO 8601, in UTC (2026-11-03T12:00:00.000Z is 9 a.m. in Brasília). In the console, you enter the date in Brasília time. A scheduled message counts toward the limit of the day it was created.
  • Draft (draft: true): only saves. Publishing later (removing the draft flag or scheduling) counts toward the limit of the day it was published.

Under Messaging, newest first, with the status:

Status What it means
Draft Saved, not sent.
Scheduled Goes out at the set date.
Processing Queued or being delivered.
Sent Delivered to the provider (deliveredTotal says to how many).
Failed No recipient received it; the reason is in deliveryErrors, in the message detail.

Deleting a message removes it from the history; what already went out can’t be recalled. Deleting a scheduled one cancels the send.

Was this page helpful?