from suprsend import Suprsend, SuprsendAPIException
supr_client = Suprsend("workspace_key", "workspace_secret")
# Define tenant ID and prepare tenant payload
tenant_id = "tenant_01"
tenant_payload = {
"tenant_name": "ABC Company",
"logo": "https://company_logo_image.png",
"primary_color": "#ff0000",
# ---- Optional Parameters -------
"secondary_color": "#00ff00",
"tertiary_color": "#0000ff",
"timezone": "America/New_York",
"blocked_channels": ["email"], # These channels will be skipped for sending notification to recipients when triggering for this tenant.
"social_links": {
"website": "https://suprsend.com",
"facebook": "",
"linkedin": "",
"x": "",
"instagram": "",
"medium": "",
"discord": "",
"telegram": "",
"youtube": "",
"tiktok": "",
},
"embedded_preference_url": "", # In-product Notification centre link for capturing user preferences.
"properties": {
"prop1": "value1",
"prop2": { "prop3": ["value2"] }
}
}
try:
response = supr_client.tenants.upsert(tenant_id, tenant_payload)
print(response)
except SuprsendAPIException as ex:
print(ex)