Social25 gives you the possibility to send automated messages to a conversation from a Process / Flow / Apex through the Social25__Post_Message method. This article explains how to use this method.
Make sure you have the Conversation ID of the conversation to which you want to send the message
Should be set to TRUE or FALSE. If you trigger the Flow after a record insert/update, then it is mandatory to set this value to TRUE
Conversation ID
This is the conversation ID to which you want to send the message
Message Type
Currently only Text is supported
Text Message
This is the text you want to send
Output
This action has the following output values, which are only available when the Asynchronous input is set to FALSE:
Message ID
This is the Heroku id of the message (not the Salesforce Id).
Status
The is the status of the message
Call method from Apex
It is also possible to call this method from Apex. This requires a list of Social25.Post_Message.PostMessageRequest objects. You need to set the following for every request object:
Asynchronous
Should be set to TRUE or FALSE. If you want to call this method from a Trigger, you have to set it to TRUE
Conversation_id
This is the conversation ID to which you want to send the message to
Type
Currently only Text is supported
Text
This is the text you want to send
//You can add multiple requests in one method call, for this a list is needed
List<Social25.Post_Message.PostMessageRequest> postMessageRequests = new List<Social25.Post_Message.PostMessageRequest>();
//Instantiate the request object
Social25.Post_Message.PostMessageRequest postMessageRequest = new Social25.Post_Message.PostMessageRequest();
postMessageRequest.asynchronous = {true or false};
postMessageRequest.conversation_id = '{The conversation identifier}';
postMessageRequest.type = 'text';
postMessageRequest.text = '{The text you want to send}';
//Add the request object to the list
postMessageRequests.add(postMessageRequest);
//Call the 'Post Message' method, a list with the send messages are returned only when asynchronous was set to false, else you get an empty list
List<Social25.Post_Message.PostMessageResponse> responses = Social25.Post_Message.call(postMessageRequests);
for (Social25.Post_Message.PostMessageResponse postMessageResponse : responses) {
String message_id = postMessageResponse.id;
String message_status = postMessageResponse.status;
}