Sisense automated emails are sent to users according to predefined scenarios. When a predefined scenario such as a build alert is triggered, an automated email is sent to the relevant Sisense users.

You can customize these emails to match your company’s branding.

This page describes the Sisense automated emails and how you can replace them with your own so each time a predefined scenario is triggered, Sisense sends your customized emails to your Sisense users.

Sisense Automated Emails

You can rebrand the following automatic emails:

  • Build Alert: Email sent each time a build alert is triggered.
  • Dashboard Errors Reports: Email sent when a dashboard report fails.
  • Dashboard Errors Reports Bulk Fail: Email sent when a large amount of email reports fail.
  • Dashboard Reports: Email sent to the recipient of a shared dashboard when you share a dashboard.
  • Empty Dashboard Report: Email sent to an administrator when an empty dashboard report is sent.
  • KPI Alert: Email sent each time a KPI alert is triggered.
  • New User Invitation: Email sent to a new user invited to Sisense.
  • Password Recovery: Email sent to a user who requested a new password.
  • Share With: Email sent to the recipient of a shared dashboard.
  • Transfer Ownership: Email sent to a user who received ownership of a dashboard from another owner.
  • User Created: Email sent to a user when a user is created.
  • User Created AD: Email sent when a user is created in Sisense after being added from Active Directory.

For each automated email, Sisense provides an email template in the format of EJS and LESS files. These files are located within template folders inside the Template Parent folder located at:

...Program Files\Sisense\PrismWeb\vnext\src\features\emails\templates

LESS Files

All templates contain the style.less file that refers to a stylesheet that defines the branding used in Sisense’s automated emails. The content of every style.less is as follows:

@import '../styles.less';

The stylesheet referred to by all the email templates is called styles.less located at:

...\Program Files\Sisense\PrismWeb\vnext\src\features\emails\templates

By replacing the content of the styles.less file with your own CSS, you can redefine the branding used in all of the email templates to your custom branding.

EJS Files

Each template folder contains an EJS file, which contains HTML and JavaScript that describe the content of the email.

You can use any text/HTML editor to modify the HTML.ejs files according to your needs.

The following is an example of an HTML.ejs file.

<% include ../header %>
    <tr>
         <td>
               <div class="contentText">
                    <p class="userText" style="margin: 0;"><%= i18nContent.hi %> <%= newOwnerUserName %>,</p>
                    <p class="generalInfo" style="margin: 0;"><%- i18nContent.generalInfo %></p>
               </div>
          </td>
       </tr>
<% include ../footer %>

 

Each EJS file has three sections, a header, body, and footer; each of which describes various areas in the email your users receive.

Section 1 is the Header section defined in the EJS file as <% include ../header %>. This is a reference to the header.ejs file located at:

…\Program Files\Sisense\PrismWeb\Resources\branding\emails

The header.ejs file defines the title and image used in the header section of each email template. You can modify the header by replacing the header.ejs file with or replace the <% include ../header %> tag from each template with your own HTML and JavaScript.

Section 2 is the Body section, which contains the content displayed in the email your users receive. There are two types of content displayed in automated emails, tokens and strings. Tokens refer to Sisense variables such as the Sisense username or dashboard owner’s name. For example, the <%= newOwnerUserName %> token displays the new owner of a dashboard’s Sisense username in the automated email.

<tr>

     <td>
          <div class="contentText">
              <p class="userText" style="margin: 0;"><%= i18nContent.hi %> <%= newOwnerUserName %>,</p>
              <p class="generalInfo" style="margin: 0;"><%- i18nContent.generalInfo %></p>
          </div>
     </td>
  </tr>

 

When you replace the HTML.ejs file with your own files, you can still use the Sisense tokens. For more information about tokens you can add to your automated emails, see Applying Sisense Tokens.

In addition, each template contains an object such as i18nContent.hi that displays strings predefined by Sisense. These strings cannot be modified, however, you can remove and replace the object with your own content.

The final section, Section 3 contains the footer. Like the header, the footer, <% include ../footer %>, is a reference to a footer.ejs file located at:

…\Program Files\Sisense\PrismWeb\Resources\branding\emails

The footer.ejs file defines the copyright text and image used in the footer section of each email template. You can modify the footer by replacing the footer.ejs file with or replace the <% include ../footer %> tag from each template with your own HTML and JavaScript.

Images that are displayed in the Header and Footer are stored in the following location:

...\Program Files\Sisense\PrismWeb\vnext\src\features\emails\templates\images

You can replace these with your own images by maintaining the same file names used, however, it is recommended to replace the content of the Header and Footer sections altogether with your own content.

Replacing Sisense Automated Emails

If you prefer to implement your own email templates for Sisense’s predefined scenarios, you can replace Sisense’s emails with your own through the Sisense REST API.

Note: Rebranding Sisense emails must be enabled for your license. Contact your Account Manager for more information.

For each automated email, Sisense provides an email template in the format of EJS and LESS files. These files are located within template folders inside the Template Parent folder located at:

...Program Files\Sisense\PrismWeb\vnext\src\features\emails\templates

Some template folders may contain an html-org.ejs file. These files are legacy templates and are maintained for backwards compatibility. Newer developments should only modify or replace the html.ejs files.

After you have prepared your new automated emails, through the /branding endpoint of the REST API, you can configure Sisense to send the customized automated emails when the relevant event is triggered.

To define the location of your branded emails:

  1. Copy the contents of the directory:
    ...Program Files\Sisense\PrismWeb\vnext\src\features\emails\templates
  2. Paste all the folders in the following directory:
    ...Program Files\Sisense\PrismWeb\Resources\branding\emails
    You will modify the templates in this folder and configure Sisense to send them instead of the original Sisense automated emails.
  3. For each template you want to modify, change the contents of html.ejs files and styles.less as described in Sisense Automated Emails.
  4. Access the Sisense REST API.
  5. In version .9 of the REST API, select the POST /branding.
  6. In the email object define the following information:
    Note: If you have already rebranded  your Sisense Web Application, copy the current settings through the GET /branding endpoint and paste them into the POST /branding endpoint modifying or adding the emails object. If you only modify the emails object, the remaining objects and keys are set to their default Sisense and will overwrite any existing settings.
    KeyDescription
    senderEmailThe email address from which the automated email is to be sent.

    When you define the senderEmail value, you must verify your domain in Sisense’s Mandrill email service. Click here for more information.
    senderNameThe directory location of your template folders. Sisense accepts /resources/branding/emails as a custom location for automated email templates.

    This directory is located on your Sisense server at ...Program Files\Sisense\PrismWeb\Resources\branding\emails
    templates_directoryCreate, update, delete, and query YouTube Analytics Groups.
    passwordRecoverySubjectThe subject line of the password recovery email.
    newUserInviteSubjectThe subject line of the new user email.
    createdUserSubjectThe subject line of the new user invite email.
    shareWithNewUserSubjectThe subject line of the shared dashboard with a new user email.
    shareWithExistingUserSubjectQuery time-based info on views, subscribers, etc. For example, how many new subscribers were gained at a specific time.
    transferOwnershipThe subject line of the dashboard transfer ownership email.
    For example:

    "emails": {
    "senderEmail": "[email protected]",
    "senderName": "sys-admin",
    "templates_directory": "/resources/branding/emails",
    "passwordRecoverySubject": "Recover Password",
    "newUserInviteSubject": "new User Account Activation",
    "shareWithNewUserSubject": "A Dashboard has been shared with you:",
    "shareWithExistingUserSubject": "A Dashboard has been shared with you:"
    },
  7. Click Run. The next time an automated email is sent, your templates are sent instead of Sisense’s predefined emails.

Applying Sisense Tokens

Most Sisense automated emails include tokens that you can apply to your automated emails. When the email is sent, Sisense populates the token with the relevant value. For example, the <%= user %> token represents the Sisense’s username.

Each template has tokens defined by Sisense that you can apply listed below. Tokens from one automated email cannot be applied to another. Applying tokens to other automated emails, for example adding <%= user %> to the KPI alert email results

build_alert: Sent when a build alert is triggered.

No Template Tokens Available

Dashboard_errors_report: Sent when an Dashboard email report fails.

Template Tokens Available

<%= user %>

<%= errors[i].user %>

<%= errors[i].error %>

<%= errors[i].widgetFailed %>

<%= errors[i].widgetCount %>

Dashboard_errors_report_bulk_fail: Sent when a Dashboard email report sent to a large amount of users fails.

Template Tokens Available

<%= user %>

<%= errors[i].user %>

<%= errors.groups[i] %>

Dashboard_report: An automated email that contains a dashboard report sent to users.

Template Tokens Available

<%= url %>

<%= images[i] %>

Empty_dashboard_report: An automated email that contains an empty dashboard report sent to users.

Template Tokens Available

<%= user %>

Kpi_alert: Sent to shared users when a KPI alert is triggered.

Template Tokens Available

<%= measure %>

<%= value %>

<%= message %>

New_user_invitation: Sent to a new user that you have invited to join.

Template Tokens Available

<%= owner %>

* The folder for this template contains a file called HTML-ORG.ejs. This file is for older versions of Sisense and is maintained for backward compatibility.

Password_recovery: Sent when a user requests their password from the Forgot Password page.

Template Tokens Available

<%= user %>

* The folder for this template contains a file called HTML-ORG.ejs. This file is for older versions of Sisense and is maintained for backward compatibility.

Share_with: Sent to a new recipient of a dashboard when the dashboard is shared with them.

Template Tokens Available

<%= user %>

* The folder for this template contains a file called HTML-ORG.ejs. This file is for older versions of Sisense and is maintained for backward compatibility.

transfer_ownership: Sent to the new owner of a dashboard when ownership is transferred.

Template Tokens Available

<%= newOwnerUserName %>

<%= oldOwnerUserName %>

<%= sharingDashboardName %>

User_created: Sent to the recipients of new Sisense accounts.

Template Tokens Available

<%= user %>

User_created_ad: Sent when a user is created in Sisense after being added from Active Directory

Template Tokens Available

<%= user %>