Sending Emails from the VAD

3CX Voice Application Designer (VAD), allows you to automatically send e-mails with or without attachments.

In this article we’ll show how to save the audio of a call to a file, and then send it as an attachment in an e-mail message.

Step 1: Create the Project

First, we need to create a new project. Open the VAD and go to “File” > “New” > “Project”,  select the folder where you want to save it, and enter a name for the project. In this case we’ll name it “EMailTest”.

emails from vad

Step 2: Save the Audio of the Call to a File

Now we’ll save the audio of the call to a file, which then will be sent as an attachment.

In order to save audio we need a Record Component. Drag it from the toolbox and drop it into the design surface of the “Main” callflow. Select the recently added component and from the Properties window configure it as follows:

  • Change the name to “recordYourName”.
  • Configure the “Prompts” with messages to invite the user to leave his/her name.
  • Configure the “SaveToFile” property with the value “true” (without quote marks).
  • Configure the “FileName” property with the following expression: CONCATENATE(‘CallFrom_’,session.ani,’.wav’)

This expression will dynamically create the file name, concatenating the text “CallFrom_” with the caller number, and finally “.wav”.

emails from vad

Step 3: Send the Recorded Audio via Email

We need to send the recorded audio as a file attached to an e-mail message. To do this, we need to add a new E-Mail Sender Component to the “Audio Recorded” branch of the Recording Component, and configure it as follows:

Note that any constant value that we may need to configure will have to be in quote marks. This is because as those fields are expressions they could reference variables or invoke functions. In order to create a constant string value, we need to add single quote marks to it.

In the Subject property, we used an expression in order to include the caller number.

The list of attachments contains files, each one described by two columns:

  • Name: this is the name of the file that the email recipient will see . Here we enter “Recording.wav” so the file will always be attached with that name.
  • File: this is an expression to look for a file with any name. Here we use the same expression that we have defined for the Record Component, so we attach the file that was recorded at that moment.

Step 4: Build and Deploy to 3CX Phone System

The project is ready. We just need to build it and deploy it to a 3CX Phone System installation.

Once deployed, we can make a call to the extension where the application has been registered and save some audio. The audio will be sent via e-mail to the configured recipient.

Liked this article?


Get notified of new articles
or share
You might also be interested in: