If you handle communications to end users on behalf of your customers, you might be tasked with handling custom styling in the messages. This can be quite cumbersome if you have to maintain these customisation for every tenant in your codebase.

Tenants empower you to send personalized communication on behalf of your customers using a single API. You just have to store tenant guidelines like logo, name, colors, social links and other custom properties for your customers once and then use your tenant variables in templates to dynamically render the template for each of your customer.

You can programatically create / update tenant tenant using either one of our backend SDKs (Python, Node, Java, Go) or through SuprSend dashboard. We’ll cover the method to create tenant using SuprSend dashboard.

Creating / Updating Tenant on SuprSend Platform

Go to Tenants page from Side Navigation panel. On the tenants page, you’ll see a default tenant created. For every organization, we create a default tenant which represents org level settings like org logo, colors, social links etc.

You can create a new tenant by clicking on “New Tenant” button.

This will open a form to add tenant id and tenant name. Add the required fields and click on Create tenant

  • Tenant id is a unique identifier for your tenant and can’t be changed once the tenant is created. You’ll have to pass tenant_id in your workflow / event calls to render tenant level customization in your templates. (if no tenant_id is passed, default tenant properties are picked). So, add a tenant_id which is unique and easily identifiable for you.

  • Tenant name can be your customer company / organization name

This will open tenant details page. Fill tenant details and Save changes. You can always come back and edit it again later

Here are the form fields and its description

FieldTypeDescription
Tenant IDstring of max character length of 64 characters with allowed characters ([a-z0-9_-] i.e. alphanumeric characters, _ (underscore) and - (hyphen).)tenant_id is used to identify tenant in workflow and event call
Tenant Namesingle line textName of the company / organization
LogoimageTenant logo. Used to render logo in email tenant header
Tenant colors6 digit color codeTenant color settings are mainly used while designing templates. Primary tenant color is used in button, header and footer border in tenant email template. If you don’t provide any of the colors for the tenant, SuprSend will assume you want to use the default values, so color settings will automatically be set to the color settings of default tenant.
Social LinksURLURLs of social media accounts of the tenant It is used to render social media logos in tenant email footer. if the link is not passed, that logo will not be shown in the footer.
Custom PropertiesJSONCustom properties associated with the tenant. The option to add custom properties is currently not available on the dashboard but you can update it using backend SDK or APIs

You can use HTTP API or manage tenants using one of our backend SDKs:

  1. Update tenant using python SDK

  2. Update tenant using node SDK

  3. Update tenant using java SDK

  4. Update tenant using go SDK

Using Tenant Components in Templates

1. Ready-to-use tenant components in email

You can use tenant component in email to add ready-to-use header, footer and buttons in your email template. Tenant component automatically uses tenant logo, social links and primary color to style the email template. You’ll find the tenant component in right side content menu in email editor.

You can add tenant component and change block type to switch between header, footer and buttons

You can change the component using standard customization options like padding, background color etc. to best suit your email template.

2. Use Tenant Variable for all Channels

You can add tenant variables in all channel templates as $tenant.<property>. For example, if you have to add tenant_name in your template, you can add it as $tenant.tenant_name. Also, when you type {, tenant variable will automatically come up in auto-suggestions for your to add in the template

Triggering notification for your Tenant

After adding the tenant variables in your template, you can add tenant_id in your workflow or event trigger to trigger notification for that tenant. This will replace tenant variables with the properties of that tenant at run time.

1. Adding tenant_id in workflow trigger

from suprsend import Workflow

# Prepare Workflow body
workflow_body = {...}   

# Add tenant_id in workflow instance
wf = Workflow(body=workflow_body, tenant_id='_tenant_id')

# Trigger workflow
response = supr_client.trigger_workflow(wf)
print(response)

2. Adding tenant_id in event trigger

from suprsend import Event

distinct_id = "distinct_id" # Mandatory, Unique id of user in your application
event_name = "event_name"   # Mandatory, name of the event you're tracking

# Properties:  Optional, default=None, a dict representing event-attributes
properties = {													
  "key1":"value1",
  "key2":"value2"
} 

# Add tenant_id in event instance
event = Event(distinct_id=distinct_id, event_name=event_name, properties=properties, tenant_id='_tenant_id_')

# Track event
response = supr_client.track_event(event)
print(response)

Possible customizations at Tenant Level

  • Custom Template Designs for Each Tenant- You can create unique template designs for each tenant using tenant-specific properties. Refer to the above section for details on how to implement this.

  • Route Tenant messages from their own vendors- You can direct messages through a tenant’s designated vendors by configuring tenant vendors on the vendor settings page. Messages will be sent via the vendor associated with the tenant_id provided in the trigger. If no tenant vendor is set, the system will use the default vendor settings.

  • Tenant level preference setting: Tenants can control what notifications should be sent to their associated users and the their default preference setting. It can be used for cases where admin wants to control the notifications that their teammates receive or when you are sending notifications to multiple tenant’s users and tenant wants to control the notifications their users receive, on which channels and at what frequency. Read more about tenant preferences here.