Message Bucket


Message bucket is the most important object in the ValueText app. You may need to know more about it when you are planing to build lot of custom logic on top of the message bucket.

Architecture:

When you send a message from any component like Record level chat console, Single Message button, Bulk Button or from process builder it will create a record at message bucket with all required values.

Trigger under message bucket will take care of message delivery.

Message bucket hold both inbound and outbound messages and it will be differentiated by Direction or Type field of the message bucket.

Find the important field of Message Bucket and their usage.

API Field

Version Advisability 

Usage

Required

Other Comments

Type__c

STANDARD and Above

Know about the direction of the message

 

Inbound or outbound are the values

rsplus__Number__c

All

Phone Number of the message

Yes

 

rsplus__Sender_ID__c

All

From number of the message

Yes

Long code, short code , Alpha Numeric id 

rsplus__Message__c

All

Body of the message

Yes*

Required if rsplus__Template_ID__c is blank

rsplus__Template_ID__c

All

Template Name

Yes*

Required if rsplus__Message__c is blank

rsplus__Related_To__c

All

Map the record id

 

Better map this value all the time but if you ara mapping rsplus__Template_ID__c then this field is required. This field will take care the relation making example. When you are creating a message from contact then pass the contact id at Message bucket so it will autocratically fill the rsplus__Contact__c

rsplus__Processed__c

All

It will mark as true when server receive the message

 

This is most important field and every outgoing message has to mark as true otherwise contact support team

rsplus__Action_Incomplete__c

All

It will mark as true when you send the message asynchronously or when record failed to process  

 

 

rsplus__Message_Cost__c

All

Amount spent for the message

 

 

rsplus__Message_Segments__c

All

Number of messages segments

 

GSM character count of messages / 160 = Total Number pf segments. For WhatsApp always 1 upto 1600 characters 

rsplus__Status__c

All

Status of the message

 

Refer API document

rsplus__Status_Code__c

All 

Status code of the message

 

Refer API document

rsplus__Status_Message__c

All

Status description

 

Refer API document

rsplus__Schedule_Time__c

All

Minute based schedule

 

This will helps you to send the message on exact time. But use text schedule and follow up for schedule messages

rsplus__Schedule_Time_Zone__c

All

Pass the time zone

 

Make sure to pass if you map the Schedule Time

rsplus__Related_Inbound_SMS_Bucket__c

All 

Related outbound for the incoming message

 

When we receive the message it will map the last outgoing message based on from and to

rsplus__File_Id__c

STANDARD And Above

If you want to send the file from apex or process builder then pass the 18 digit salesforce of the File record.

 

Id must be File type not attachment or any other type

rsplus__Media_Json__c

STANDARD And Above

Internal use

 

 

rsplus__Is_Opted_Out__c

STANDARD And Above

It will mark as true if received message contains STOP or Unsubscribe

 

Use this field to handle opt out. Please read more about Opt Out document

rsplus__Quick_reply__c

STANDARD And Above

Pass any values in this field and that will deliver as outgoing message.

 

Message type must be Inbound then only this function work

rsplus__Read__c

STANDARD And Above

If you read the message from chat console then this will mark as true

 

Only works on record level chat console and chat console tab. You can use this field for internal purpose in any of the process

rsplus__Reated_To_Name_Formula__c

STANDARD And Above

Related name is derived automatically if the message linked to contact, account, lead, opportunity and case from name field and the same will be shown in chat console tab

 

If the message bucket linked to other object or if you want to overwrite the value then you can map the value at rsplus__Related_to_name__c field 

rsplus__Related_to_name__c

 

STANDARD And Above

Helps to overwrite rsplus__Reated_To_Name_Formula__c field value

 

 

rsplus__SMS_ID__c

All

Id generated by ValueText server

 

 

rsplus__External_Id_Txt__c

All

Message bucket record id

 

 

rsplus__Business_Hours__c

STANDARD And Above

Map the business hours

 

This will help you, If you want to control you message delivery as per the the business hours available 

rsplus__Is_it_out_of_business_hours__c

STANDARD And Above

Will be true if the message is trying to send non business hours based on Business hours mapped.

 

If business hours logic applied then it will be true automatically

rsplus__Job_Name__c

STANDARD And Above

You can pass any value and no logic. For your reporting purpose 

 

You can group them in report based on the value

rsplus__Is_replied__c

STANDARD And Above

True if you get any reply for the outbound message

 

 

rsplus__Channel__c

STANDARD And Above

Requested channel like WHATSAPP,SMS

 

Order of channel execution

rsplus__Processed_Channel__c

STANDARD And Above

Channel message was sent

 

Final channel used for message delivery based on rsplus__Channel__c field  values

rsplus__Template_Name__c

All

Deprecated

 

 

rsplus__Push_Notification_User_1__c

STANDARD And Above

Future use

 

 

rsplus__Push_Notification_User_2__c

STANDARD And Above

Future use

 

 

rsplus__Resend_Push_Notification__c

STANDARD And Above

Helps to re trigger push notification in case of fail

 

 

rsplus__Smart_routing_enforced__c

STANDARD And Above

deprecated

 

 

rsplus__SMS_Campaign__c

STANDARD And Above

Campaign id if send from campaign

 

 

rsplus__SMS_Campaign_Member__c

STANDARD And Above

Deprecated

 

 

rsplus__sObject_Name__c

STANDARD And Above

Object name based on rsplus__Related_To__c

 

 

rsplus__Source__c

STANDARD And Above

Future use

 

 

rsplus__Stop_Push_Notification__c

STANDARD And Above

If you don’t want to send  message to phone then you can mark as true

 

Helps to stop sending the messages to phone

rsplus__SyncType__c

All

If you create the messages from future method then this field will have value “Asynchronous”

 

These messages will be processed by schedule job

rsplus__Time_Convert__c

All

Internal use

 

 

rsplus__User__c

All

Deprecated

 

 

rsplus__Related_User__c

All

Owner of the message

 

 

rsplus__Eligible_for_omni_channel_alert__c

STANDARD And Above

It will be true if the record meet the Omni channel.

 

You can fire the assignment rules based on this checkbox

rsplus__Group_Or_Queue_Id__c

STANDARD And Above

Pass group id if you want to send messages to group of people

 

For internal message sending to group of people

rsplus__Open_Id_Type__c

STANDARD And Above

Type of data at Number field like Facebook id, Viber id, Wechat id or Line

 

 

rsplus__Template_Name__c

All

Deprecated

 

 

rsplus__Related_Inbound_SMS__c

STANDARD And Above

Deprecated

 

 

rsplus__Related_SMS_Inbox_Actions__c

STANDARD And Above

Deprecated

 

 

rsplus__Related_SMS_Scheduler__c

STANDARD And Above

Related schedule record which used to create Message Bucket record

 

 

rsplus__allFilesSize__c

STANDARD And Above

Internal use

 

 

Best practices for Message Bucket

Your custom code logic will impact on speed of delivery especially when you are using BOT or auto reply flow if you have.

Example when you build a reply Msg flow it will send the message after completion of custom logic under the message bucket. Speed of message directly impact on your custom logic.

If you have any other logic like record update then handle asynchronously ( Future method).

Don’t send any messages from future method from your logic because trigger under message bucket will initiate the API call from future method. As per the Salesforce limit you can not call one future method from other future method.

Still you can create a message bucket record from asynchronous because our schedule jobs will pick up failed messages and send the messages in 1 to 10 minutes time. You will see action incomplete at message bucket marked as true in this case.

Run most of your code in future method is the best practice.