ImportAndSendMessage
Imports contact or message data and immediately initiates message sends in Salesforce Marketing Cloud. This procedure combines data ingestion and outbound communication in a single automated operation to support rapid campaign deployment.
EXECUTE ImportAndSendMessage MessageId = 'MessageId', " +
"Keyword = 'Test_Keyword'," +
"NotificationEmail = '[email protected]'," +
"IsDuplicationAllowed = true," +
"IsDuplicationAllowed = true," +
"ImportDefinition = '[{" +
" \"FileName\": \"MyTestList.csv\"," +
" \"ImportType\": \"FILE\"," +
" \"ImportMappingType\": \"ManualMap\"," +
" \"FieldMaps\": [{" +
" \"Destination\": \"_FirstName\"," +
" \"Source\": \"First Name\"" +
" }, {" +
" \"Destination\": \"_Subscriberkey\"," +
" \"Source\": \"Subscriber Key\"" +
" }, {" +
" \"Destination\": \"_LastName\"," +
" \"Source\": \"Last Name\"" +
" }, {" +
" \"Destination\": \"_MobileNumber\"," +
" \"Source\": \"Mobile\"" +
" }, {" +
" \"Destination\": \"_CountryCode\"," +
" \"Source\": \"Country\"" +
" }]" +
" }]'
Input
| Name | Type | Required | Description |
| MessageId | String | True | Specifies the encoded message identifier (Id) of the MobileConnect message that is used during the import-and-send operation. This Id links the import request to the correct message template or send definition. |
| Keyword | String | True | Specifies the valid keyword on the associated short code that is used to opt the imported mobile numbers into the program. Using this keyword ensures that recipients are subscribed before message delivery occurs. |
| NotificationEmail | String | False | Specifies the email address that receives notifications when the import operation completes. This value provides visibility into job status and helps administrators monitor automated sends. |
| Override | Boolean | False | A Boolean field that is set to a value of 'true' when the override message text should be used instead of the default message. It is set to a value of 'false' when the system should send the original configured message. |
| OverrideText | String | False | Specifies the message text that replaces the default message when the Override parameter is set to a value of 'true'. This text provides customized content for the outbound send. |
| IsDuplicationAllowed | Boolean | False | A Boolean field that is set to a value of 'true' when duplicate messages are permitted during the import-and-send operation. It is set to a value of 'false' when duplicate sends should be prevented. |
| IsVisible | Boolean | False | A Boolean field that is set to a value of 'true' when the import definition and the automatically created list should be visible in the MobileConnect interface. It is set to a value of 'false' when these resources should remain hidden from standard user views. |
| ImportDefinition | String | True | Specifies the list of import definitions that should be created as part of the import-and-send operation. Currently, only one import definition is supported per request. |
Result Set Columns
| Name | Type | Description |
| TokenId | String | Returns the token Id that represents the queued import-and-send job. This Id can be used to retrieve status information or the results of the operation. |
| LastPublishDate | String | Returns the date and time when the associated message or import definition was last published. This value helps confirm that the latest configuration was used during the operation. |