Email script examples
An 8x8 Contact Center email script uses the information contained in an email message to route the message to one or more email queues. Use 8x8 Configuration Manager to create email scripts.
The following procedure illustrates how to combine 8x8 Contact Center email script objects with script object control flow features:
- Delete email messages that contain viruses.
- Inspect an email message subject line.
- Route email messages to queues.
- Insert stop processing objects into email scripts.
- Enable an email channel.
Before you begin
The procedure in this section assumes that you have used 8x8 Configuration Manager to create at least one email queue. For details on creating email queues, refer to Create Email Queues.
Best Practice: Before editing a 8x8 Contact Center script, disable the email channel.
- From the Configuration Menu, open Channels.
- Go to the Email tab.
- Find the desired channel, and click .
- In the Properties tab, clear This channel is enabled.
- Click Save.
For details on email channels properties, refer to Configure Email Channel Properties.
If your email server does not provide protection against email viruses, include the Check Virus script object at the top of all your email scripts to help protect your contact center from malicious email messages.
Note: If your server already protects against email viruses, do not use the Check Virus object.
To inspect the email messages for viruses:
- From the Configuration Menu, open Scripts.
- Go to the Email tab.
- Find the desired script, and click .
- In the Script tab, click Email Routing, then click [add].
- In the Insert object selection list, select Check Virus.
- Enter an Object tag, such as <CV01>, and click OK.
8x8 Configuration Manager adds the Check Virus script object to the script. The Check Virus script object contains the exit points labeled infected and not Infected. - Delete any email messages infected by viruses:
- Under the Check Virus script object, click [add] next to infected.
- In the Insert object selection list, select Delete Email.
- Enter an Object tag, such as <Delete Infected>, then click OK.
Use the same script design principles to incorporate the Check Spam and Check Flood objects into an email script.
Use the Check Subject in the email script to inspect the subject line of incoming email messages for a particular string.
To inspect an email message's subject line:
- In the above example, click [add] next to not infected.
- In the script object selection list, select Check Subject.
- Enter an Object tag, such as <CS01>.
- In the Select Operator list, choose Contains.
- In the Pattern text entry area, type <ADV>.
- Clear Use pattern as a POSIX extended regular expression and Negate comparison.
- Select Case Sensitive.
- Click OK.
8x8 Configuration Manager inserts the Check Subject script object below not infected.
Use the comparison results returned by the Check Subject to route email messages.
To use the results Check Subject to route the message:
- Delete email messages that contain a certain string, such as <ADV>, in the subject area.
- Under Check Subject, click [add] next to matched.
- Select Delete Email from the Insert object list.
- Enter an object tag, such as <DelADV>, then click OK.
The email script deletes all incoming email messages that contain <ADV> in the subject line.
- For all messages that do not contain <ADV> in the subject area, route the message to an email queue.
- If the message does not exceed the value specified by Maximum number of emails waiting, then stop script processing:
- Under Forward to queue, click [add] next to routed.
- Select Stop processing from the Insert object list.
- Enter an Object tag, and click OK.
After routing the message, the script stops.
- If the message exceeds the value specified by Maximum number of emails waiting (in the email queue), then send the email to an overload queue:
- Under Forward to queue, click [add] next to overload.
- Select Forward to Queue from the Insert object list.
- Enter an Object tag.
- Enter the Maximum number of emails waiting.
- Click OK.
Use the Forward to Queue script object to specify a secondary email queue that receives messages that exceed the primary queue's Maximum number of emails waiting setting. - Click to Save your script.
The procedure discussed in Route Email Messages to Queues illustrates the use of the Stop processing email script object to end the operation of an email script.
Insert Stop processing objects at all points where you intend the script to stop. Doing so ensures that the script always behaves as designed.
Perform the procedure in this section to enable an email channel, and run the channel's email script.
To enable the email channel:
- From the Configuration Menu, open Channels.
- Go to the Email tab.
- Find the desired script, and click .
- In the Properties tab, select This channel is enabled.
- Click Save.
The 8x8 Contact Center puts the email channel and associated script into service.
You can now send test messages to the email channel to validate the operation of the script. For details on email channel properties, refer to Configure Email Channel Properties.