Forward E-mail to multiple SMS recipients
You can use Auron Omni to forward an e-mail message to multiple SMS recipients.
In this example we forward an e-mail alert to all members of a dedicated ICT support team. An Excel sheet contains the contact information of the support team.
This example walks through the configuration of the following items:
- Create an SMS campaign for the ICT support team
- Set up an e-mail forward trigger from a template
- Modify the trigger to use an existing SMS campaign
Before starting, make sure that you have already configured these channels:
- An incoming e-mail channel. This can be either IMAP or POP3.
- An outgoing SMS channel. This can be either GSM, HTTP or SMPP.
Create the ICT Support campaign
The ICT support campaign contains a reference to the data source with the ICT support contact details. In this example we use a central Microsoft Excel sheet. It could also be an external database or a CSV file.
Start creating a new campaign by following these steps:
- Open the Auron Omni Manager application
- Open the Campaigns section in the tree view on the left
- Click New Campaign
We call the campaign ICTTEAM with the description Report to ICT.
This example uses an existing SMPP channel to send SMS messages and uses Excel as the data source.
The campaign wizard asks you to format an SMS text for the campaign. This text can be anything because we do not use it when forwarding the e-mail message.
When forwarding e-mail messages to the campaign, we use the actual e-mail content. This test message is only used to validate the campaign.
After the campaign is created, you can test it by clicking the green play button in the campaign overview.
Set up the e-mail forward trigger
We set up an e-mail forward trigger from the Forward Trigger Template.
Even though it is not exactly what we need because it only forwards to a single recipient, it is a good starting point. We modify the trigger after creating it.
Start creating a new trigger in Auron Omni Manager by following these steps:
- Open the Triggers section in the tree view on the left
- Click New Trigger in the view on the right
- Select Forward Trigger Template from the list of available templates
- Click Create
We call the trigger FWDTOTEAM with the description Forward e-mail alerts to team.
We choose VBScript as the scripting language for this trigger. If you prefer JavaScript, you can use that instead.
In the next step, choose to forward from your incoming e-mail channel to the SMPP channel. This ensures the trigger condition is generated correctly for this scenario.
The final step asks you to format the forwarded text by mapping e-mail parts to SMS parts. We leave the defaults.
Modify the trigger
Next we review the generated trigger and update it so it forwards to a campaign instead of a single recipient.
To find the trigger script:
- Open the Triggers section in the tree view on the left
- Click the Edit (pencil) icon next to the trigger
- Select the VBScript tab in the Edit Trigger dialog
- Click the Edit (pencil) icon next to the script path
The script contains two parts. The first part is the trigger function:
' // ========================================================================
' // Function: ProcessMessageEx
' // ------------------------------------------------------------------------
' // ProcessMessageEx trigger function to process incoming messages
' // ========================================================================
Function ProcessMessageEx(objMessageIn, objMessageDB, dctContext)
Log ">> ProcessMessageEx"
Forward objMessageIn, objMessageDB
Log "<< ProcessMessageEx"
End Function
We keep this part unchanged. We only update the Forward function.
Replace the existing Forward function (from Function Forward(objMessageIn, objMessageDB) to End Function) with the following:
' // ========================================================================
' // Forward
' // ------------------------------------------------------------------------
' // Automatically forward this message
' // ========================================================================
Function Forward(objMessageIn, objMessageDB)
Log ">> Forward"
' prefer the plain text body
sBody = objMessageIn.BodyPlainText
If sBody = "" Then
sBody = objMessageIn.BodyHtml
End If
' ensure the body contains no HTML formatting
Set objHtmlToText = CreateObject("AxEmail.Message")
sBody = objHtmlToText.HtmlToPlainText(sBody)
' run the campaign with a custom SMS body
Set objCampaignManager = CreateObject("AxMmServer.CampaignManager")
objCampaignManager.CustomSmsMessage = sBody
objCampaignManager.Run "CONSIGNMENT"
' handle errors
If objCampaignManager.LastError <> 0 Then
objMessageIn.StatusID = g_objConstants.MESSAGESTATUS_FAILED
objMessageIn.AddTrace objCampaignManager.LastErrorDescription
Else
objMessageIn.AddTrace "Forwarded to 'CONSIGNMENT' campaign'"
End If
Log "<< Forward"
End Function
It also uses the ‘HtmlToPlainText‘ method to strip any HTML tags that may be part of the e-mail message so the SMS does not grow too large.
It then runs the CONSIGNMENT campaign and sends the message to all recipients in the campaign data source.
Finally, enable the trigger so it automatically processes incoming e-mails.






