What it does
Reads up to 100 contacts that match a filter, builds a personal greeting from a template, and sends each one as a system IM notification (im.notify) to the contact's assigned manager. Pauses between sends to respect rate limits.
Stack
Node.js 18+. No external dependencies.
Environment
export B24_HOOK='https://your.bitrix24.com/rest/1/secret'
Run
npx tsx 02-mass-messaging.ts
Source
The full file is published in the skill at skills/b24jssdk-recipes/examples/02-mass-messaging.ts.
Notes
im.notifyrequires the IM module to be enabled on the portal.- The example sends to the assigned manager of each contact, not to the contact directly. To DM the contact instead, use
imopenlines.crm.message.add(Open Channels). - For thousands of contacts use
actions.v2.fetchList.makeand split the sends acrossactions.v2.batchByChunk.makeinstead of a sleep loop.