Note: Beginning October 1, 2017, references to @contact inside the "Send a message to someone else" action will be refer to the active contact in the run, not the recipient for the message. To reference the details for the recipient, instead start that contact in a flow and use the normal Send Message action with @contact.
Place this action at any step in a flow to send a message to someone other than the active contact that reaches that step. For example, this action can be used to:
- alert others of a contact's progress in a flow
- alert others of a contact's response to a question in a flow
- link a contact to a team member capable of continuing the conversation directly from their own phone.
The following is an example of a flow configured to forward a contact's response to a specific question to members of your team:
After the contact receives the initial message ("Thanks for reaching out..."), they'll reply with their question, comment or concern (handled by the "Wait for QCC" RuleSet). Next, they'll pass through a Split by Contact Field RuleSets that will determine whether or not the contact has been assigned a name up to this point. If they haven't they'll be directed to a branch that asks for their name and updates it to their "name" field before placing them in the last step. If they have been assigned a name, they'll continue on the the last step. To reference the active contact, add the @step prefix to the contact variables you'd like to call, e.g. @step.contact.name.
- Responses to the initial question are collected by the "Wait for QCC" RuleSet, which saves all responses as the flow variable @flow.qcc.
+ By attaching a Send Message to Somebody Else action to a step that follows the Wait for QCC step, we're able to capture the responses it collects:
In the message above, we use variables to represent the following information about each contact that reaches this step:
+ @step.contact.name - represents the name of the active contact - the contact who passes through the Send a Message to Somebody Else action.
+ @flow.qcc - represents the individual contact's response to the initial question, collected by the Wait for QCC step.
+ @flow.qcc.time - the time at which the individual contact's response was collected by the Wait for QCC step.
+ @step.contact.tel - the locally-formatted phone number of the active contact (as opposed to the E_164-formatted phone number (@step.contact.tel_e164), which would also provide the country code prefix).
@step.contact vs. @contact
Note that there are two ways to reference contacts and their fields within a workflow:
@contact - references the contact receiving the message. In most cases, this is the active contact - the person whose responses are being handled by the workflow. When using the Send a Message to Someone Else action, @contact refers to the contact or group of contacts to which the message is being sent.
@step.contact - references the contact who sent the last message handled by the workflow. In most cases, this is also the active contact. When using the Send an SMS Response action, @step.contact and @contact are the same contact. When using the Send a Message to Someone Else action, @step.contact refers to the contact who has reached the Send a Message to Someone Else action within the flow, thus triggering it to send.
Here's an example:
Since the message created by the Send a Message to Someone Else action is being sent to Edward, @contact.first_name will be replaced with Edward's first name. @step.contact.name and @step.contact.tel will be replaced with the name and phone number of the patient that just registered via the workflow containing the Send a Message to Someone Else action.
For more information about variables, visit the Flow Variable Reference.