Email Server Integration

There are two situations where Graphlytic needs an Email Server integration to be configured:

  • Password management: User invitations, Forgot password workflow, and forced password reset. See the chapter "SMTP for Password Management" below for more details.

  • Situations, where an external system or person needs to be notified, can be also handled by the ETL jobs module. Take a look at the ETL: Mail2 driver or use Groovy scripts to run an external script that will take care of the job.

SMTP for Password Management

The default (out of the box) functionality of Graphlytic comes with User Management features that don't involve the user's input in the process.

SMTP integration configuration is needed for additional use cases like:

  • sending email invitations to new users with a link for creating a password,

  • self-service password reset (Forgotten password workflow), and

  • force-reset of password where admin blocks the user and an email with password change link is sent.

In order to turn on the SMTP integration this has to be done:

  1. added configuration in the graphlytic.conf file,

  2. email templates added to the installation,

  3. application restarted.

Configuration

The configuration has to be added in the <GRAPHLYTIC_HOME>/conf/graphlytic.conf file (application needs to be restarted after any change in this conf file). Here is an example of the configuration and description of each of the attributes:

# Java duration format
password.reset.hash.validity=P1D
password.change.hash.validity=P1D
password.create.hash.validity=P7D
# EMALING
email.smtp.host=localhost
email.smtp.port=1025
email.smtp.username=
email.smtp.password=
email.smtp.auth=false
email.smtp.starttls.enable=false
email.from.address=info@graphlytic.com
email.base.path=http://localhost:8080/
email.template.dir=../emailing/
email.template.password.reset.subject=Testing password reset
email.template.password.reset=tellic_reset_html.ftl
email.template.password.create.subject=Testing password create
email.template.password.create=tellic_create_html.ftl
email.template.password.change.subject=Testing password change
email.template.password.change=tellic_update_html.ftl

Property key

Value data type

Description

password.reset.hash.validity

Java duration string

Validity duration for password change links generated on the login's page forgot password form. Format: ISO 8601 duration.

password.change.hash.validity

Java duration string

Validity duration for password change links generated by the admin on the User management page. Format: ISO 8601 duration.

password.create.hash.validity

Java duration string

Validity duration for invitation links generated when a new user is created. Format: ISO 8601 duration.

email.smtp.host

String

SMTP connection configuration - hostname of the email server

email.smtp.port

Number

SMTP connection configuration - port number of the email server

email.smtp.username

String

SMTP connection configuration - email server's user used to send emails

email.smtp.password

String

SMTP connection configuration - user's password

email.smtp.auth

Boolean

SMTP connection configuration - enable/disable (true/false) authentication for the email server

email.smtp.starttls

Boolean

SMTP connection configuration - enable/disable (true/false) TLS communication

email.from.address

Email address string

Email address used in sending emails as the "from" address

email.base.path

URL string

Base path used to generate an URL link in emails. The Graphlytic's instance base URL should be used here.

email.template.dir

Path string

Relative or absolute path to the folder with the email templates.

email.template.password.reset.subject

String

The subject of the email sent after the login's page forgot password form submit

email.template.password.reset

File name string

The filename of the email template used to generate the email sent after the login's page forgot password form submit

email.template.password.create.subject

String

The subject of the email sent after a new user is created with an invitation email

email.template.password.create

File name string

The filename of the email template used to generate the email sent after a new user is created with an invitation email

email.template.password.change.subject

String

The subject of the email sent after the user's password is force-reset by the admin

email.template.password.change

File name string

The filename of the email template used to generate the email after the user's password is force-reset by the admin

Startup check

SMTP connection is tested during Graphlytic startup. If the connection was successful an info message is in the log.

Successful example:

20.05.14 15:46:54.613 INFO [Scanner-1] s.d.g.GraphlyticConfiguration:119 - SMTP connection successful

Unsuccessful example:

20.05.14 15:46:58.613 INFO [Scanner-1] s.d.g.GraphlyticConfiguration:119 - SMTP server is unreachable

Email templates

Examples of email templates are in the attachment of this page (see below).

Location of email templates is configured in graphlytic.conf (see above).

These dynamic fields can be used in emails:

Field

Data type

Description

${username}

String

User's username (login name).

${link}

String

Generater URL link for password change.

${validTill}

Date

Time validity of the generated URL link. Can be formated with FTL date formating: https://freemarker.apache.org/docs/ref_builtins_date.html

Examples:

${validTill?date} - only date part

${validTill?time} - only time part

${validTill ?iso_utc } - e.g. 2011-05-16T21:32:13Z

${validTill ?string["dd.MM.yyyy, HH:mm"] } - e.g. 08.04.2003 21:24

${validTill?string.long} - e.g. April 20, 2007

${firstName}

OPTIONAL

String

User's first name. This is an optional value field and can be empty.

${lastName}

OPTIONAL

String

User's last name. This is an optional value field and can be empty.

Example

<h1>Resetting email test</h1>
Dear ${username}
<br/>
Link to change the password is <a href="${link}">here</a>. The link will be valid till ${validTill}.
<br/>
First name: ${firstName}
Last name: ${lastName}

Graphlytic's default templates

Name

Version

Published

update_html.ftl

1

2021-01-10 08:09

reset_html.ftl

1

2021-01-10 08:09

create_html.ftl

1

2021-01-10 08:09