v1.2.0

Mass messaging

Filter contacts in CRM, personalise a template, send IM notifications to assigned managers.

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.notify requires 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.make and split the sends across actions.v2.batchByChunk.make instead of a sleep loop.