Whilst most readers and writers are file-based, it is also possible to retrieve and send emails using the following:
get-email- retrieve emails from an IMAP folder, FROM and SUBJECT can be stored in variablessend-email- send emails via SMTP, the from/to/subject/body options automatically expand variables
The connection parameters are obtained through environment variables that are stored in .env files.
The following pipeline uses the get-email reader to poll the audio folder
for new messages with WAV attachments every 5 seconds. These audio files get
downloaded and then forwarded to the send-email writer that attaches
the audio files and then sends an email to the specified email address: