No, they work fine now. I use them in production.
Sure. There are 2 levels of formatting:
Notification formatting
- When a system wants to send notifications, it sends events to notifo. These events can have custom properties. At the moment only these properties are available:
- SquidexApp: The name of your app.
{{SquidexApp}}
- SquidexUrl: The URL to a content item:
{{SquidexUrl}}
- Name: The name of the schema.
- Status: The status of the content.
Channel formatting
Each channel has its own formatting and most of them use liquid. A notification is then embedded into the channel template. Here a wide range of variables are available:
{
"items": [
{
"path": "app",
"type": "Object",
"description": "The current app."
},
{
"path": "app.name",
"type": "String",
"description": "The name of the app. Cannot be null or undefined."
},
{
"path": "notification",
"type": "Object",
"description": "The first and usually single notifications. For emails multiple notifications can be grouped in one template."
},
{
"path": "notification.body",
"type": "String",
"description": "The notification body. Can be null or undefined."
},
{
"path": "notification.children",
"type": "Array",
"description": "The child notifications if the notifications have been grouped together."
},
{
"path": "notification.confirmText",
"type": "String",
"description": "The text for confirmation buttons."
},
{
"path": "notification.confirmUrl",
"type": "String",
"description": "The tracking URL to mark the notification as confirmed."
},
{
"path": "notification.imageLarge",
"type": "String",
"description": "The URL to the large image. Optimized for the current use case (e.g. emails). Can be null or undefined."
},
{
"path": "notification.imageSmall",
"type": "String",
"description": "The URL to the small image. Optimized for the current use case (e.g. emails). Can be null or undefined."
},
{
"path": "notification.linkText",
"type": "String",
"description": "The link text that can be set when a linkUrl is set. Can be null or undefined."
},
{
"path": "notification.linkUrl",
"type": "String",
"description": "The link URL. Can be null or undefined."
},
{
"path": "notification.subject",
"type": "String",
"description": "The notification subject. Cannot be null or undefined."
},
{
"path": "notification.trackDeliveredUrl",
"type": "String",
"description": "The tracking URL to mark the notification as delivered."
},
{
"path": "notification.trackSeenUrl",
"type": "String",
"description": "The tracking URL to mark the notification as seen."
},
{
"path": "notifications",
"type": "Array",
"description": "The list of notifications. Usually it is only one, but for emails multiple notifications can be grouped in one template."
},
{
"path": "user",
"type": "Object",
"description": "The current user."
},
{
"path": "user.emailAddress",
"type": "String",
"description": "The email address of the user. Can be null or undefined."
},
{
"path": "user.fullName",
"type": "String",
"description": "The full name of the user. Can be null or undefined."
},
{
"path": "user.phoneNumber",
"type": "String",
"description": "The phone number of the user. Can be null or undefined."
}
],
"total": 0
}
Here are the templates that I use for the squidex cloud:
{
"items": [
{
"code": "AppContributorAssignedEventV2",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {
"subject": {
"en": "{{ squidexApp }}: A contributor has been assigned."
},
"body": {},
"confirmText": {},
"imageSmall": {},
"imageLarge": {},
"linkUrl": {},
"linkText": {},
"confirmMode": "None"
},
"settings": {}
},
{
"code": "AppContributorRemovedEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {
"subject": {
"en": "{{ squidexApp }}: A contributor has been removed."
},
"body": {},
"confirmText": {},
"imageSmall": {},
"imageLarge": {},
"linkUrl": {},
"linkText": {},
"confirmMode": "None"
},
"settings": {}
},
{
"code": "AppPlanChangedEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {},
"settings": {}
},
{
"code": "AppPlanResetEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {},
"settings": {}
},
{
"code": "ContentCreatedEventV2",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {
"subject": {
"en": "{{ squidexApp }}: A {{ name }} content has been created."
},
"body": {},
"confirmText": {},
"imageSmall": {},
"imageLarge": {},
"linkUrl": {},
"linkText": {},
"confirmMode": "None"
},
"settings": {}
},
{
"code": "ContentDeletedEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {
"subject": {
"en": "{{ squidexApp }}: A {{ name }} content has been deleted."
},
"body": {},
"confirmText": {},
"imageSmall": {},
"imageLarge": {},
"linkUrl": {},
"linkText": {},
"confirmMode": "None"
},
"settings": {}
},
{
"code": "ContentDraftCreatedEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {},
"settings": {}
},
{
"code": "ContentDraftDeletedEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {},
"settings": {}
},
{
"code": "ContentStatusChangedEventV2",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {
"subject": {
"en": "{{ squidexApp }}: A {{ name }} content has been set to {{ status }}."
},
"body": {},
"confirmText": {},
"imageSmall": {},
"imageLarge": {},
"linkUrl": {},
"linkText": {},
"confirmMode": "None"
},
"settings": {}
},
{
"code": "ContentStatusScheduledEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {},
"settings": {}
},
{
"code": "ContentUpdatedEvent",
"created": "1970-01-01T00:00:00Z",
"lastUpdate": "1970-01-01T00:00:00Z",
"formatting": {
"subject": {
"en": "{{ squidexApp }}: A {{ name }} content has been updated."
},
"body": {},
"confirmText": {},
"imageSmall": {},
"imageLarge": {},
"linkUrl": {},
"linkText": {},
"confirmMode": "None"
},
"settings": {}
}
],
"total": 11
}
The templates are created the first time a notification arrives´, but if they have no subject the notification just gets ignored.