# send-email

Send events as email messages. The event payload becomes the email body. Supports authenticated and unauthenticated SMTP. Waits for all inflight emails before shutting down.

# Config

Required:

  • host: SMTP server hostname
  • to: Function that returns recipient email address
  • from: Function that returns sender email address
  • subject: Function that returns email subject

Optional:

  • port (number): SMTP port (default: 587)
  • user (string): SMTP username
  • password (string): SMTP password

# Example

pipeline:
  send-email:
    config:
      host: smtp.example.com
      port: 587
      user: logbus
      password: secret
      to: !!js/function >-
        function(event) {
          return event.email
        }
      from: !!js/function >-
        () => 'LogBus <logbus@tfks.net>'
      subject: !!js/function >-
        () => 'LogBus ❤️ SMTP'