Child pages
  • Outbound Email connectivity
Skip to end of metadata
Go to start of metadata

The external Email connectivity provides outbound email services.

Prerequisite

The external Email connectivity service requires the Javamail library file (mail.jar) to be copied in the OpenIDM bundle/ folder.

Router Context

external/email

Allows for access via the resource API from scripts

External Access

External access can be disabled in the router policy.

if exposed through the inbound REST interface the outbound functionality can be exercised at 

/openidm/external/email

This allows for testing the outbound Email functionality

Example Script Access

Emails are accessible via the action function in the resource API

 openidm.action("external/email", params);

Example External Access

http://localhost:8080/openidm/external/email
HTTP POST
 {
    "_from" : "openidm@example.com",
    "_to" : "idmadmin@example.com",
    "_subject" : "Reconciliation report",
    "_body" : "This is the reconciliation report:...."
}

Invocation Parameters

Invocation Parameters are passed in the resource API parameters map, and can override static configuration (if present) on a per invocation basis. Invocation Parameters are prefixed with an underscore to identify them as built in parameters and to separate them from arbitrary user tokens.

  • _from : String - sender email address (From:)
  • _to : String - comma separated list of email recipients (To:)
  • _cc : String (optional) - comma separated list of email recipients (Cc:)
  • _bcc : String (optional) - comma separated list of email recipients (Bcc:)
  • _subject : String ("<no subject>") - The email subject
  • _type : String ("text/plain") - The email MIME type ("text/plain", "text/xml", "text/html" are handled)
  • _body : String ("<empty message>") - The email body text

Configuration file

Supply the following properties in the external.email.json configuration file:

  • host : String ("localhost") - the email server (SMTP) host name or IP address
  • port : String ("25") - the email server port number
  • mail.smtp.auth: String ("false") - enable SMTP AUTH
  • username: String - the user name for SMTP AUTH (only used if mail.smtp.auth is true)
  • password: String - the user password for SMTP AUTH (only used if mail.smtp.auth is true)
  • mail.smtp.starttls.enable: String ("false") - enable TLS for secure connection
  • from: String - default From: email address. Optional. Override with _from parameter

example

{
        "host" : "smtp.gmail.com",
        "port" : "587",
        "username" : "john.smith",
        "password" : "secret",
        "mail.smtp.auth" : "true",
        "mail.smtp.starttls.enable" : "true",
}
  • No labels