---
title: Send SMS in a flow pro process
slug: voice-german/send-sms-in-a-flow-pro-process
docTags: 
createdAt: 2024-03-19T15:32:27.852Z
---

An SMS can be sent out automatically using a workflow e.g., in the process builder.

To do that, you need to specify parameters like a subject line or SMS text.

Required parameters to invoke Apex

•Mobile Phone number

•Contact or lead or account relationship, e.g. direct ID

•Subject line (option)

•SMS text (mandatory)

•Call result (option) - either complete name or API name

•Call result group (option) - either complete name or API name

If no mobile phone number is specified, a contact or lead or account relationship is required. If both are specified, the mobile number has priority.

A task is created depending on the configuration settings and considering the record type. If the subject line is empty, the SMS subject line from the configuration is use

## Steps to send SMS via Process builder

## Step1

Go to Salesforce Setup-> (Quick search)-Process Builder ->Click on “New“ to create new process.

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/process1.png)

## Step2

Click to add an object for that process is created. Example: Case. Also select when record is created as we want to send the SMS when case is created.

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/process2.png)

## Step3

Define case criteria.

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/process3.png)

## Step4

Add action for that criteria, select Apex and the apex class *Mirage\_\_MirageSMSUsingProcess* that we are calling.

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/process4.png)

## Step5

Now set values for the Apex method variables.

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/process5.png)

*Parameters used to pass values from process are -*

•*recordId*

Ex- ContactID(The SMS will go to that object's mobile number, Ex- contact mobile number )

Ex- AccountId(The SMS will go to that object's Phone number, Ex- Account phone number)

Ex- LeadID(The SMS will go to that object's mobile number, Ex- Lead mobile number )

•*defaultDestinationNumber*

Mobile number to which SMS will be sent

•*textMessage*&#x20;

Body of the message to send SMS

•*subjectLine*&#x20;

Subject to create activity

•*wrapUp*&#x20;

To fill call result to activity

•*createActivityForSMS*

When true, activity is created

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/process6.png)

**Flow / Process with SMS Template**

It is possible to use an SMS template. Just add the ID of the e-mail template in the field:**&#x20;templateID**

To retrieve the ID of the template, open the template and copy the ID from the URL.

<u>Example</u>

https\://mycompany.lightning.force.com/lightning/setup/CommunicationTemplatesEmail/page?address=%2F**00X5i000001ZTAZEA4**%3Fsetupid%3DCommunicationTemplatesEmail

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/sms-template.png)

**SMS Configuration scenarios**

*scenario 1 - Default destination number is specified.*

SMS will be sent to the default destination number specified in the configuration

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/case1_defaultdestinationnumber_sms.png)

*Scenario 2 - Record id is specified*

SMS will be sent to the record (Contact/Account/Lead) mobile/phone number specified in the configuration.

Ex- ContactId (The SMS will go to that object's mobile number, Ex- contact mobile number )

Ex- AccountId (The SMS will go to that object's Phone number, Ex- Account phone number)

Ex- LeadId (The SMS will go to that object's mobile number, Ex- Lead mobile number )

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/case2_recordid_sms.png)

*Scenario 3 - Default destination number and record id both are specified*

SMS will be sent to the default destination number specified in the configuration. Priority is always given to the default destination number over the record id.

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/case3_defaultdestinationnumber_recordid_both_sms.png)

*Scenario 4 - Custom object*

An SMS can be sent using a phone number on a **custom object.** The only limitation is that a task can not be created as the custom object would not be linked to the task.

•defaultDestinationNumber must be set to the phone number filed of the custom object

•createActivityForSMS must be set to false

![](https://helpserver.biz/onlinehelp/cdc/sf/5.0/help2000/images/sms-custom-object.png)

