Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Scroll export button
scopecurrent
template-id0fa09813-8b86-460a-aa1d-ef450a80e9ce
quick-starttrue
add-onScroll PDF Exporter

Info

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

Created: October 2023

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

Table of Contents


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:

Code Block
System(echosendemail "email body" | mutt -F /etc/companies.d/0/Muttrc -s youremail@domain.com" "email subject" youremail@domain.com) -a"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

Image Removed

Option 2: Use 'sendemail' application 

...

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

...

  • /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 the file you want to attach to the email

Image Added

Option 2: Use HTML template file

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

...

Code Block
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})

...

Code Block
System(sendemail \"youremail@domain.com\" \"email subject" /var/lib/callweaver/sounds/00000path/to/some_attachment_file.wav < /tmp/mail_${UNIQUEID})

...