Platform Events
RME publishes Platform Events so business logic can react to communication outcomes without polling.
Events
| Event | Published when |
|---|---|
RME_Delivery_Event__e | Any normalized provider event (sent, delivered, open, click, bounce, complaint, read, answered) |
RME_Message_Failed__e | A message exhausts its retry policy |
RME_Inbound_Message__e | An inbound reply, SMS, or WhatsApp message is received |
RME_Consent_Changed__e | Consent is granted or revoked on any channel |
RME_Provider_Health__e | A provider circuit breaker opens or closes |
Delivery event fields
| Field | Type | Example |
|---|---|---|
Message_Id__c | Text(18) | a0X5f000001AbCdEAK |
Channel__c | Text | |
Event_Type__c | Text | delivered |
Provider__c | Text | SENDGRID |
Provider_Message_Id__c | Text | 14c5d75ce93.dfd.64b469 |
Recipient__c | Text | customer@example.com |
Occurred_At__c | DateTime | 2026-08-03T18:22:11Z |
Payload__c | LongTextArea | Raw normalized JSON |
Subscribing in Apex
trigger RmeDeliveryEventTrigger on rme__RME_Delivery_Event__e (after insert) {
List<Task> followUps = new List<Task>();
for (rme__RME_Delivery_Event__e e : Trigger.new) {
if (e.rme__Event_Type__c == 'complaint') {
followUps.add(new Task(
Subject = 'Spam complaint — review outreach cadence',
WhoId = RME_DeliveryStatus.contactIdFor(e.rme__Message_Id__c),
Priority= 'High'));
}
}
insert followUps;
}
Subscribing in Flow
Create a platform-event-triggered Flow on RME_Delivery_Event__e with an entry condition such as Event_Type__c equals bounce. Flow subscribers run as the Automated Process user — grant that user access to any objects you update.
Subscribing outside Salesforce
Use the Pub/Sub API to stream events into an external system without polling:
grpcurl -H "accesstoken: $ACCESS_TOKEN" \
-H "instanceurl: https://<my-domain>.my.salesforce.com" \
-H "tenantid: $ORG_ID" \
-d '{"topicName":"/event/rme__RME_Delivery_Event__e","numRequested":100}' \
api.pubsub.salesforce.com:7443 \
eventbus.v1.PubSub/Subscribe
Delivery guarantees
Platform Events are at-least-once. Make subscribers idempotent by keying on Provider_Message_Id__c plus Event_Type__c plus Occurred_At__c. High-volume events are retained for 72 hours and can be replayed by replay id.
Continue to Data Model.
Was this helpful?
Last updated 1 month ago