Skip to main content
Code42 Support

Customize enterprise email templates

Available in:

StandardPremiumEnterprise
Small Business
Applies to:

Overview

Your Code42 environment sends email notifications for many types of events such as backup status alerts, password recovery requests, and account creation invitations. These email notifications are based on standardized templates stored on your authority server.

To customize the emails sent to users and administrators in your Code42 environment, use the Code42 API's customAssetresource to place customized versions of the email templates on your authority server.

Considerations

  • This process requires use of the Code42 API.
  • You must have a private authority server to customize your email notifications.
  • We recommend creating and testing your custom email templates in a test environment before applying them to your production Code42 environment.
  • When customizing your email notifications with this process, your customizations are retained even when you upgrade your Code42 environment to a newer version.

Customize email templates

The example steps shown here use curl, a command-line tool on Linux and Mac for HTTP communication. Other tools are also available. In particular, we recommend the PowerShell cmdlet Invoke-RestMethod for Windows administrators.

For more information on the customAsset resource, review the details in the Code42 API documentation viewer.

Step 1: Retrieve an email template

  1. Adapt the following API request to get a list of all email templates from your authority server:
    • Example API request:
      curl -X GET -u 'username:password' 'https://master-server.example.com:4285/api/customAsset'
      
    • Excerpt of successful response from your authority server:
      {
        "metadata": {
          "timestamp": "2016-01-27T20:56:54.824-06:00",
          "params": {}
        },
        "data": {
          "emailTemplates": [
            {
              "file": "recover_password.eml",
              "isCustom": false
            },
      ...
      
  2. Select one email template to customize, such as recover_password.eml.
  3. Adapt the following API request to download the selected email template from your authority server:
    • Example API request:
      curl -X GET -u 'username:password' 'https://master-server.example.com:4285/api/customAsset/recover_password.eml' -o recover_password.eml
      
    • Excerpt of successful response from your authority server:
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.7.0_60-ea" class="java.beans.XMLDecoder">
          <object class="com.code42.email.EmailResource">
              <void property="htmlPart">
                  <string>##
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
      ...
      

Step 2: Modify the downloaded email template

The email template is an .eml file that primarily uses HTML syntax. Modify the contents of your selected email template as desired.

Image locations on your Authority server

You can include custom images in .png or .gif format in your customized email templates. When doing so, consider the relative locations of your email templates and customized images on your authority server's file system:

  • Custom email templates:
    • Linux: /opt/proserver/content-custom/Default-custom/emails/templated
      Applies to Code42 servers installed as root on Ubuntu
    • Windows: C:\Program Files\CrashPlan PROe Server\content-custom\Default-custom\emails\templated
  • Custom images:
    • Linux: /opt/proserver/content-custom/Default-custom/shared/custom
      • Applies to servers installed as root on Ubuntu
    • Windows: C:\Program Files\CrashPlan PROe Server\content-custom\Default-custom\shared\custom

Example image code

This example shows how to refer to a custom image within your custom email template:

#set($logoImage = $attachments.add("/shared/custom/code42_header_logo.png"))

Step 3: Place the customized resources on your Authority server

Send your customized email templates (and any accompanying images) to your authority server using the Code42 API.

  1. Adapt the following API request to send your customized email template (.eml format) to your authority server:
    • Example API request:
      curl -X PUT -u 'username:password' 'https://master-server.example.com:4285/api/customAsset/recover_password.eml' -F 'customAsset=@recover_password.eml'
      
    • Successful response from your authority server:
      {"metadata":{"timestamp":"2016-01-27T18:01:02.889-06:00","params":{}},"data":{"file":"recover_password.eml","isCustom":true
      
  2. Adapt the following API request to send any custom images (.png or .gif format) used in your customized template to your authority server:
    • Example API request:
      curl -X PUT -u 'username:password' 'https://master-server.example.com:4285/api/customAsset/custom_image.png' -F 'customAsset=@custom_image.png' 
      
    • Successful response from your authority server:
      {"metadata":{"timestamp":"2016-01-27T18:01:02.889-06:00","params":{}},"data":{"file":"custom_image.png","isCustom":true
      

Step 4: Verify that emails use your customized template

You can confirm that your customized email is working by either reviewing an example email or by checking the list of customized emails on your authority server.

Review example emails

Use the administration console command line to trigger an example email notification.

  1. Sign in to your administration console.
  2. Double-click the Code42 logo in the upper left to open the administration console command-line interface (CLI).
  3. Enter thetest.emailcommand to send a test email to a specified email address:
    test.email address@example.com /emails/templated/recover_password.eml
    
    • Substitute your email address for address@example.com
    • Substitute your customized email template for recover_password.eml

Check the authority server's list of customized emails

The customAsset resource also displays a list of which email templates are customized. For example, this example API request produces the following response after customizing the recover_password.eml template:

curl -X GET -u 'username:password' 'https://master-server.example.com:4285/api/customAsset' 
{
  "metadata": {
    "timestamp": "2016-01-27T21:01:15.071-06:00",
    "params": {}
  },
  "data": {
    "emailTemplates": [
      {
        "file": "recover_password.eml",
        "isCustom": false
      },
      {
        "file": "reset_password.eml",
        "isCustom": false
      },
      {
        "file": "backup_alert_admin.eml",
        "isCustom": false
      },
      {
        "file": "welcome_user.eml",
        "isCustom": false
      },
      {
        "file": "backup_report_admin.eml",
        "isCustom": false
      },
      {
        "file": "connection_alert_admin.eml",
        "isCustom": false
      },
      {
        "file": "system_alert_admin.eml",
        "isCustom": false
      },
      {
        "file": "backup_alert_user.eml",
        "isCustom": false
      },
      {
        "file": "backup_report_user.eml",
        "isCustom": false
      },
      {
        "file": "directory_sync_summary.eml",
        "isCustom": false
      },
      {
        "file": "invite_user.eml",
        "isCustom": false
      },
      {
        "file": "license_alert_admin.eml",
        "isCustom": false
      },
      {
        "file": "recover_password.eml",
        "isCustom": true
      }
    ],
    "images": [
      {
        "file": "custom_image.png",
        "isCustom": true
      }
    ]
  }
}

Update customized email templates

You can update a previously customized email template by sending a new customized email template to your master server. Sending a new customized template overwrites any previous customized templates.

  • Was this article helpful?