Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
Dev Center
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log in or Sign up
View categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Node.js Behavior in Heroku
      • Troubleshooting Node.js Apps
      • Working with Node.js
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • Working with PHP
      • PHP Behavior in Heroku
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
    • Vector Database
    • Model Context Protocol
    • Heroku Inference
      • AI Models
      • Inference Essentials
      • Inference API
      • Heroku Inference Quick Start Guides
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
obsolete

This add-on is operated by Trustifi

Trustifi gives you complete control of your email communications.

obsolete

Last updated May 16, 2022

This is a draft article - the text and URL may change in the future. This article is unlisted. Only contributors can access it.

The obsolete add-on is currently in beta.

Table of Contents

  • Installing the Trustifi add-on
  • Local setup
  • Using with cURL
  • Using with jQuery
  • Using with Ruby
  • Using with Python
  • Using with Node
  • Using with PHP
  • Using with Go
  • Use templates with dynamic data
  • Dashboard
  • Troubleshooting
  • Migrating between plans
  • Removing the add-on
  • GDPR
  • Support

Trustifi is your comprehensive email tool-box:

  • Easily send secured, tracked and encrypted emails using your address (or one of our dedicated addresses) - in order to maintain compliance (HIPAA, GDPR, PCI, etc.) and keep the data of your users/recipients secure and private.
  • Secured and encrypted storage for your files - easy to access, upload and download.
  • Dynamic templates - send highly customized emails with dynamic fields to fit your purpose and recipients.
  • Most importantly - never lose your data. All info is kept secure and encrypted in our easy-to-use web app. All sent emails, attachments, contacts and templates are accessible at any point.

Installing the Trustifi add-on

Installation through Heroku CLI

$ heroku addons:create trustifi:test
-----> Creating trustifi on sharp-mountain-4005... done, v18 (test)

Installation through Heroku Dashboard

  • From your application’s “Resources” tab, scroll down to the “Add-ons” section and search for “Trustifi”:

Trustifi add-on search

  • A pop-up will open, choose the relevant plan from the list and click “Provision”:

Provision Trustifi add-on

After you install Trustifi, your application should be configured to fully integrate with the add-on. You will be required to verify your email address before being able to perform any actions with the add-on.

Local setup

Environment setup

After you provision the add-on, it’s necessary to locally replicate its config vars so your development environment can operate against the service.

Use the Heroku Local command-line tool to configure, run and manage process types specified in your app’s Procfile. Heroku Local reads configuration variables from a .env file. To view all of your app’s config vars, type heroku config. Use the following command for each value that you want to add to your .env file:

$ heroku config:get trustifi -s  >> .env

Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore.

For more information, see the Heroku Local article.

Using with cURL

The following code example will send an email using the Trustifi API to a single recipient.

curl --location --request POST "$TRUSTIFI_URL/email" \
  --header "x-trustifi-key: $TRUSTIFI_KEY" \
  --header "x-trustifi-secret: $TRUSTIFI_SECRET" \
  --header "content-type: application/json" \
  --data "{
  \"recipients\": [{\"email\": \"test@gmail.com\", \"name\": \"test\", \"phone\":{\"country_code\":\"+1\",\"phone_number\":\"1111111111\"}}],
  \"attachments\": [],
  \"title\": \"Title\",
  \"html\": \"Body\",
  \"methods\": {
    \"postmark\": false,
    \"secureSend\": false,
    \"secureReply\": false
  }
}"

For more code samples, response samples and additional information, see https://api.trustifi.com/

Using with jQuery

Here is an example of how to retrieve all information for emails a user has sent:

var settings = {
  "url": TRUSTIFI_URL+"/email/display/info/"+email_id,
  "method": "GET",
  "headers": {
    "x-trustifi-key": TRUSTIFI_KEY,
    "x-trustifi-secret": TRUSTIFI_SECRET,
    "content-type": "application/json"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

For more code samples, response samples and additional information, see https://api.trustifi.com/

Using with Ruby

Here is an example of how to create a custom email template:

require "uri"
require "net/http"
require "json"

url = URI.parse("#{ENV['TRUSTIFI_URL']}/template")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

@toSend = {
  "name" => "template name",
  "title" => "template title",
  "html" => "<p>body for this template</p>",
  "attachments" => ["5b39de9a2afa6100046a1234"]
}.to_json

request = Net::HTTP::Post.new(url)
request["x-trustifi-key"] = ENV['TRUSTIFI_KEY']
request["x-trustifi-secret"] = ENV['TRUSTIFI_SECRET']
request["content-type"] = "application/json"
request.body = "[ #{@toSend} ]"

response = https.request(request)
puts response.read_body

For more code samples, response samples and additional information, see https://api.trustifi.com/

Using with Python

The following code example will send an email using the Trustifi API to a single recipient.

import requests
import os
import json

url = os.environ['TRUSTIFI_KEY']+'/email'
payload = json.dumps({
  "name": "template name",
  "title": "template title",
  "html": "<p>body for this template</p>",
  "attachments": []
})
headers = {
  'x-trustifi-key': os.environ['TRUSTIFI_KEY'],
  'x-trustifi-secret': os.environ['TRUSTIFI_SECRET'],
  'content-type': 'application/json'
}
response = requests.request('POST', url, headers = headers, data = payload)
print(response.json())

For more code samples, response samples and additional information, see https://api.trustifi.com/

Using with Node

Here is an example of how get all tracking information for a sent email:

const request = require('request');

request.get(process.env.TRUSTIFI_URL + '/event/'+email_id, {
   headers: {
    'x-trustifi-key': process.env.TRUSTIFI_KEY,
    'x-trustifi-secret': process.env.TRUSTIFI_SECRET
  },
   json: true
}, (err, res, body) => {
   console.log(body);
})

For more code samples, response samples and additional information, see https://api.trustifi.com/

Using with PHP

Here is an example of how to retrieve all information for emails a user has sent:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "$_ENV['TRUSTIFI_URL']/email/display/info/$email_id",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "x-trustifi-key: $_ENV['TRUSTIFI_KEY']",
    "x-trustifi-secret: $_ENV['TRUSTIFI_SECRET']",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
} ?>

For more code samples, response samples and additional information, see https://api.trustifi.com/

Using with Go

Here is an example of how to get all the information about a user’s templates:

package main

import (
  "fmt"
  "strings"
  "os"
  "path/filepath"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "{{TRUSTIFI_URL}}/template/{{template_id}}"
  method := "GET"

  payload := strings.NewReader("{\n    \"advanced\": {\n    \"general\": {\n      \"reply_to_enable\": true,\n      \"reply_to_email\": \"aaaa@gmail.com\"\n    },\n    \"email_me\": {\n      \"on_received\": true\n    },\n    \"secure\": {\n        \"encrypt_content\": true,\n        \"secure_received\": true\n    }\n  }\n}")

  client := &http.Client {
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
      return http.ErrUseLastResponse
    },
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
  }
  req.Header.Add("x-trustifi-key", "{{TRUSTIFI_KEY}}")
  req.Header.Add("x-trustifi-secret", "{{TRUSTIFI_SECRET}}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  defer res.Body.Close()
  body, err := ioutil.ReadAll(res.Body)

  fmt.Println(string(body))
}

For more code samples, response samples and additional information, see https://api.trustifi.com/

Use templates with dynamic data

Trustifi allows you to create customized email templates that can be used for customer engagement. You can make use of dynamic fields (see explanation below) to personalize the emails to your company and recipients.

Trustifi templates

Creating a template

Below is an example of creating a Trustifi template - fields surrounded by curly braces are dynamic fields.

For example - {{REC.NAME}} will refer to the specific recipient of the email and {{SENDER_EMAIL}} will refer to the sender’s email address.

Dynamic fields can be used in the email’s body and subject.

const request = require('request');

var postData =  {
      "name": "template name",
      "title": "template title",
      "html": "<p>body for this template</p>",
      "attachments": []
 };

request.post(process.env.TRUSTIFI_URL+'/template', {
   headers: {
      'x-trustifi-key': process.env.TRUSTIFI_KEY,
      'x-trustifi-secret': process.env.TRUSTIFI_SECRET
   },
   json: postData
}, (err, res, body) => {
   console.log(body);
})

Here’s how a customized template looks like in the Trustifi dashboard. Notice the dynamic fields (surrounded by curly braces), these fields will display the relevant information when the email arrives in the recipient’s inbox:

Trustifi template sender side

See Our API documentation for a more detailed example.

Sending a template with dynamic fields

To send an email with a predefined template, you can refer to it by name in your “Compose email” (POST) request. Custom dynamic fields can be declared here. In this example, {{first_field}} translates to “hello” and {{second_field}} translates to “world”.

const request = require('request');

var postData =  {
  "template": {
    "name": "my_template",
    "fields": {
      "first_field": "hello",
      "second_field": "world"
    },
  },
  "recipients": [{
    "email": "recipient@domain.com",
    "name": "test",
    "phone": {
      "country_code": "+1",
      "phone_number": "1111111111"
    },
  }],
  "methods": {
    "postmark": false,
    "secureSend": false,
    "secureReply": false
  }
};

request.post(process.env.TRUSTIFI_URL+'/email', {
   headers: {
      'x-trustifi-key': process.env.TRUSTIFI_KEY,
      'x-trustifi-secret': process.env.TRUSTIFI_SECRET
   },
   json: postData
}, (err, res, body) => {
   console.log(body);
})

Here is how the same template from before would look like, once it arrives in the recipient’s inbox. Notice that the dynamic fields like {{REC.NAME}} display the relevant information:

Trustifi template recipient side

See Our API documentation for more information.

Dashboard

$ heroku addons:open trustifi
Opening trustifi for sharp-mountain-4005

Trustifi Dashboard

You can also access the dashboard by visiting the Heroku Dashboard and selecting Trustifi from the Add-ons menu:

Trustifi SSO

By clicking on the Trustifi add-on, you will be logged in to your account using Single Sign On

Features and capabilities of the Trustifi dashboard

View tracking information for sent emails

  • Who opened the email? As well as where did they open it from and with which device/browser?
  • Were any of the links in the email body clicked?
  • Were any of the email’s attachments downloaded?
  • Did the recipient(s) pass or fail Multi-Factor-Authentication?
  • Was the email printed?
  • More

Tracking information

Control sent emails

  • Block recipients from accessing the email or block the email for everyone
  • Recall the email to edit the the content after it was sent
  • Set or change an expiration date for the email
  • More

Upload a custom logo

You are able to upload a custom logo from the “Settings” page. The logo will be used in all of your encrypted emails sent with Trustifi.

Add additional “from” addresses

You can add and verify additional email addresses to be used as the “from” address in your emails. Addresses can be added from the “Settings” page.

Add account email

Email addresses must be verified before they can be used. To verify, click on the provided link in the email received from Trustifi Service.

Sending an email with a custom “from” address

After the email address has been verified, you may add the “from” object to your POST request and set the “email” field as the new email address:

const request = require('request');

var postData =  {
  "from":{
    "email": "yourfromaddress@domain.com"
  },
  "recipients": [{
    "email": "recipient@domain.com",
    "name": "test",
    "phone": {
      "country_code": "+1",
      "phone_number": "1111111111"
    }
  }],
  "template": {
    "name": "my_template",
    "fields": {
      "first_field": "hello",
      "second_field": "world"
    }
  },
  "attachments": [],
  "title": "Title",
  "html": "Body",
  "methods": {
    "postmark": false,
    "secureSend": false,
    "secureReply": false
  }
};

request.post(process.env.TRUSTIFI_URL+'/email', {
   headers: {
      'x-trustifi-key': process.env.TRUSTIFI_KEY,
      'x-trustifi-secret': process.env.TRUSTIFI_SECRET
   },
   json: postData
}, (err, res, body) => {
   console.log(body);
})

Secure attachments storage

Every attachment sent with Trustifi is saved in an encrypted database and can be accessed from the “Secure Storage” page of the dashboard.

Secure Storage

Information available for your attachments:

  • When was it uploaded?
  • Which email(s) contain this attachment?
  • Does this attachment contain sensitive information?
  • What kind of sensitive content does the attachment contain?

Here’s an example of uploading an attachment using the Trustifi add-on:

const request = require('request');

request.post(process.env.TRUSTIFI_URL+'/attachment', {
   headers: {
      'x-trustifi-key': process.env.TRUSTIFI_KEY,
      'x-trustifi-secret': process.env.TRUSTIFI_SECRET
   },
   formData: {
      file: {
         value: File_Content_Buffer,
         options: {contentType: File_Content_Type, filename: File_Name}
      }
   }
}, (err, res, body) => {
   console.log(body);
})

For more information on the features available within the Trustifi dashboard, please see the documentation at Trustifi docs.

Troubleshooting

See https://api.trustifi.com for more information about correct usage and responses

Email address is not verified (error code 400 - bad request)

You must verify your email address by clicking on the provided link in the email sent from Trustifi Support

User plan is blocked (error code 400 - bad request)

Contact support at heroku-support@trustificorp.com.

User plan is expired (error code 400 - bad request)

Can be solved by upgrading your plan

For these and any other issues not mentioned here, please contact us at heroku-support@trustificorp.com.

Migrating between plans

A list of all plans available can be found here.

[[Specific migration process or any migration tips ‘n tricks]]

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade trustifi:newplan
-----> Upgrading trustifi:newplan to sharp-mountain-4005... done, v18 ($49/mo)
       Your plan has been updated to: trustifi:newplan

Removing the add-on

You can remove Trustifi via the CLI:

This will destroy all associated data and cannot be undone!

$ heroku addons:destroy trustifi
-----> Removing trustifi from sharp-mountain-4005... done, v20 (test)

GDPR

Information about GDPR can be found here

Support

All Trustifi support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at our support email.

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices