Real Messaging Engine

Platform Events

RME publishes Platform Events so business logic can react to communication outcomes without polling.

Events

EventPublished when
RME_Delivery_Event__eAny normalized provider event (sent, delivered, open, click, bounce, complaint, read, answered)
RME_Message_Failed__eA message exhausts its retry policy
RME_Inbound_Message__eAn inbound reply, SMS, or WhatsApp message is received
RME_Consent_Changed__eConsent is granted or revoked on any channel
RME_Provider_Health__eA provider circuit breaker opens or closes

Delivery event fields

FieldTypeExample
Message_Id__cText(18)a0X5f000001AbCdEAK
Channel__cTextEMAIL
Event_Type__cTextdelivered
Provider__cTextSENDGRID
Provider_Message_Id__cText14c5d75ce93.dfd.64b469
Recipient__cTextcustomer@example.com
Occurred_At__cDateTime2026-08-03T18:22:11Z
Payload__cLongTextAreaRaw 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