Skip to end of banner
Go to start of banner

How to send email from Dialplan

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

The document describes ways of configuring Dialplan to send an email.

Created: October 2023

Permalink: https://wildix.atlassian.net/wiki/x/AQCnEQ


There are several ways you can send email from Dialplan:

Option 1: Use 'sendemail' application 

1. Add Custom application in Dialplan

2. In the Custom application field, enter the following data:

System(sendemail "youremail@domain.com" "email subject" "email body" /path/to/some_attachment_file.wav)

Where you need to replace the following points with the relevant info: 

  • email body: the the content of your email
  • email subject: the subject of your email
  • youremail@domain.com: replace with the email address where the email should be sent from
  • /path/to/some_attachment_file.wav: path to the file you want to attach to the email

Option 2: Use HTML template file

This method allows you to compose a more complex email using an HTML template file. 

1. Create HMTL email body and save to /tmp/ folder

2. Send the message to specific mail direction

3. Remove mail body file from tmp folder

For this, you need to add three Custom applications with the following data:

1) Custom application:

System(echo '<html><head></head><body> Missed call from ${CALLERID(name)} from the number <a href="tel:${CALLERID(num)}">${CALLERID(num)}</a>.</body></html>' > /tmp/mail_${UNIQUEID})

2) Custom application:

System(sendemail "youremail@domain.com" "email subject" /path/to/some_attachment_file.wav < /tmp/mail_${UNIQUEID})

3) Custom application:

System(rm /tmp/mail_${UNIQUEID})


  • No labels