1.3 - Example 1: Send an email for each incoming call

So lets get started and bring everything together. What can events and actions do - that's what we want you to understand in the upcoming sections.

In this easy first example we'll just send yourself an email at the start of a new call reaching babelforce:

 

3_Chapter_1.3.png

We will be looking into two different setups. In one case, we will just send a general, rather boring text, to your inbox.

In the second example, you'll learn about "Expressions". We will explain how you can, very easily print all available Expressions to an email.

The third example will then explain how you can use these expressions by taking so called "Placeholders". They allow you to print dynamic text to your email.

At the end, we'll show you how to read Events in the live logs we had already introduced in the last chapter.

All you need for this and all other examples: 

  1. A phone number that routes to any Application Module, for instance, you can route the call to a Welcome Prompt.

 

1a: Set up and test basic event to send an email action

In babelforce Integrated processes > Events, create a new "Event Trigger" and select the event "Inbound call" and the Action "send email". Enter an email address that you use and send yourself a message. It will look like this:

 

 

Next, go to the section "Numbers". Check that you have a phone number and that it is routed to an Application module. It will look something like the example on the right hand:

 

mceclip1.pngNow call the number from your own cell phone or another phone.

You will receive an email. But not a very interesting one :-)

 

1b: Add some more interesting data from the call - print all Expressions

We can actually add a lot of interesting data to your email.

Simply paste this placeholder {core.expressions} into the email body in the action. Your Event-trigger-action will now look like the left-hand example.

This will reveal in your email the entire set of expressions and their values currently set in the system and available to use for other automations. Part of it will look like this:

send_call_data_to_email_for_inbound_call_event.png

[call.from.number] evaluates to [4930920373300]
[call.from.anonymous] evaluates to [false]
[call.from.mobile] evaluates to [false]
[call.displayAs] evaluates to [null]
[call.to] evaluates to [4930920373321]
[call.to.number] evaluates to [4930920373321]

.... 

The items on the left are the EXPRESSIONS and on the right you see the current value of the expression at the time of the "Inbound call" event. So for instance, the moment the call reached the platform, the expression call.to was equal to 4930920373321.

We have many articles on this topic if you feel like you need more information. This whole section is solely dedicated to Expressions and Placeholders:

2: Use specific Placeholders to make your email content more useful

Take the same call flow setup as in our use case 1a. Again, we want to send an email on an incoming call, however this time we want to make some use of expressions and put interesting content in the email.

To achieves this, select expressions from the list you sent to your inbox earlier. Find something that is interesting and tells you something about the caller. When you decided which expressions you want to use, put curly brackets around them. As soon as you do this, they become so called placeholder: they can now be put into a text to hold the place for the real value. For instance, if you want to know the value for call.from.number do this: {call.from.number}.

To make the email content even more valuable, put some information before and after the placeholder so you know what the printed value actually means.

So we can, for instance, format our email using the "send email" action with useful information like this:

mceclip0.png

And that's how the email will look like when you receive a call:

To learn more about specific placeholders, read this article.

3 - Test your setup: How to see what happens on your call with live logs

As already introduced in Chapter 2, Section 3.6, we recommend that you test your call flows by enabling Live Logging. It's the same when you setup events. You can see them in these logs.

Let's give that a try. Enable Live logging and repeat your test inbound call. You will see something like this in the live logs when your call arrives on the babelforce platform:

live_logs_for_a_test_call.png

As you can see the call first hits the call flow voice application and simultaneously it triggers the email action in the event you created. Once you have multiple automations and potentially multiple call flows, you will see them all being fired here.

Great, the first step is made, you have build your first global events. Let's continue withe the next use cases, this time we will introduce you to SMS events. Enjoy!

Have more questions? Submit a request