# Password Reset and Welcome Emails

When the workspace portal is activated, users can set their own passwords by receiving special authenticated links from the application administrators by email. Two types of emails are available. The welcome email is a notification to a user that an account has been created for them and is sent by an administrator in the management portal. The link in this email is valid for 72 hours. Additionally, users can request a password reset email from the workspace portal. This link is valid for 3 hours.

# Configuring SMTP

The application can be configured to send account setup and password reset emails. To do this an SMTP server must be configured for sending mail by setting smtp_host, smtp_port and smtp_sender. Credentials can be configured using smtp_username and smtp_password. The setting smtp_extra_headers can be used to provide customized email headers.

# Customizing Emails

The contents of the emails can be completely customized using HTML templates. A default template is included in the install directory. To create your own template, simply copy this file to application configuration directory and modify it as desired. Then update password_reset_template or welcome_email_template to that file path. You must include the template strings {{.WorkspaceURL}}, {{.Username}}, and {{.ResetLink}} in your customized templates.

The subject lines of the emails can be configured using password_reset_subject or welcome_email_subject.


Do not modify the provided templates in /opt/filemage/templates or C:\Program Files\FileMage\Gateway\templates\ as these files could be deleted during upgrades. Instead copy these files to /etc/filemage/ or C:\ProgramData\FileMage\Gateway\.

By default the links generated in the emails will use the public IP address of the virtual machine or the value of the first entry in acme_hostname if present. To specify a custom URL use the workspace_public_url setting.

# Sample Configuration

The following example sets up email sending using SendGrid with customized subject lines.

smtp_host: smtp.sendgrid.net
smtp_sender: no-reply@mycompany.com
smtp_username: apikey
smtp_password: SG.YW_xsmQx...
password_reset_subject: "[MyCompany] Your password reset instructions."
welcome_email_subject: "[MyCompany] A new account has been created for you."
workspace_public_url: https://files.mycompany.com

# Customizing SendGrid Unsubscribe Groups

It is possible to use specific SendGrid unsubscribe group using headers. The included SendGrid templates add the SendGrid specific <%asm_group_unsubscribe_url%> template string which adds the group unsubscribe link, and the unsubscribe group is specified using SMTP headers.

  x-smtpapi: '{ "asm_group_id": <SENDGRID_UNSUBSCRIBE_GROUP_ID> }'
password_reset_template: /opt/filemage/templates/reset_sendgrid.html
welcome_email_template: /opt/filemage/templates/welcome_sendgrid.html

# SendGrid Documentation

How to Send an SMTP Email

Creating an API key

Building an X-SMTPAPI Header

Group Unsubscribe Substitution Tag