Back to Home

Sending an e-mail message in the 3CX development environment Call Flow Designer / 3CX Ltd. company blog

call flow designer · 3cx · e-mail attachment · voice application · sending e-mail

Sending an e-mail message in the 3CX Call Flow Designer development environment

Introduction


In this article, we will tell you how to send an e-mail message from 3CX Call Flow Designer using the Email Sender component. The application records the voice of the caller in a WAV file and sends it as an e-mail attachment.
 
You can use this component, for example, to notify about the order of goods through the 3CX voice menu, and in other situations when the user's voice interaction with the system should be accompanied by sending an e-mail.
 
Recall that in previous articles we examined the creation of a CFD application for outgoing calls (upon completion of calls you can send a report using the Email Sender component), the work of CFDs with databases (which can also be used to obtain a subscriber number) androuting of incoming calls depending on the time of day (which can be combined with outgoing calls)
 
Please note that the 3CX CFD development environment is supplied free of charge. But voice applications will only run on the 3CX edition of Pro and Enterprise . You can download CFDs from here .       
 
The demo project of this voice application comes with the 3CX CFD distribution kit and is located in the Documents \ 3CX Call Flow Designer Demos folder . In the demo application, to get started, just specify the parameters of your SMTP server.

Project creation


To create a CFD project, go to File → New → Project , specify the project location folder and its name, for example, EMailDemo .



Write user message to file


First, write the subscriber’s message to a file. This file will then be sent to e-mail. For this, the Record component is used .



  1. Drag the Record component into the main window of the development environment (into the voice application Main ). Go to the properties window and rename the component to recordYourMessage .
  2. Double-click on the component and in the window that opens, set the following parameters:

CONCATENATE("CallFrom_",session.ani,".wav")



Sending recorded message by e-mail


Now send the recorded audio file as an e-mail attachment. To do this, add the E-Mail Sender component to the Audio Recorded branch of the Record component and configure it as shown below:



Note that in the parameters where the expressions are indicated (the fields have the Fx button on the right), any specified constant must be enclosed in quotation marks, since These fields can also contain variables or expression results.

For the Subject parameter, we use an expression that adds the number of the caller. Attachments

attachment list contains file descriptions, consisting of two columns:

  • Name - the name of the file that the recipient of the e-mail message will see. We specify Recording.wav here so that only the file with this name comes in the attachment.
  • File - an expression that points to the physical file of the record to be attached to the letter. However, here we must supplement the expression generating the file name (which was used in the previous step). In the previous step , the relative path to the file was used in the Record component - only the name was specified. The file was created in the audio file directory of this project. The full path to the file should be passed to the Email Sender component , so the expression is complemented by the session.audioFolder variable :

CONCATENATE(session.audioFolder,"/CallFrom_",session.ani,".wav")

Now the voice application will correctly find and embed the audio file.

Compiling and installing the application on the 3CX server


The voice application is ready! Now it should be compiled and downloaded to the 3CX server. For this:

  • Go to Build -> Build All , and CFD will create the EMailDemo.tcxvoiceapp file .
  • Go to the 3CX management interface, under Call Queues . Create a new Call Queue, specify the name and extension of the Queue, and then select the Voice applications option and download the compiled file.
  • Save the changes to Call Queues. The voice application is ready to use.

Read Next