Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

CustomNotificationType

Represents the metadata associated with a custom notification type.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

For more information about custom notifications, see Custom Notification Actions. This type extends the Metadata metadata type and inherits its fullName field.

Declarative Metadata File Suffix and Directory Location

The file suffix is .notiftype for the notification type definition. Notification types are stored in the notificationtypes directory of the corresponding package directory.

Version

CustomNotificationType components are available in API version 46.0 and later.

Fields

Field Name Field Type Description
actionGroups (Beta) CustomNotificationActionGroup[] Optional. Indicates whether mobile action groups are enabled, allowing users to take actions directly from mobile notifications.
customNotifTypeName string Required. Specifies a notification type name. Maximum number of characters: 80.
description string Specifies a general description of the notification type, which is displayed with the notification type name. Maximum number of characters: 255.
desktop boolean Required. Indicates whether the desktop delivery channel is enabled (true) or not (false).
masterLabel string Required. Specifies the label for the notification type.
mobile boolean Required. Indicates whether the mobile delivery channel is enabled (true) or not (false).
slack boolean Reserved for future use.

CustomNotificationActionGroup

CustomNotificationActionGroup represents the action group.

Field Name Description
actions
Field Type
CustomNotificationActionDefinition[]
Description
Represents the actions within a mobile action group.
groupName
Field Type
string
Description

Required.

Unique name of the mobile action group.

CustomNotificationActionDefinition

CustomNotificationActionDefinition represents the metadata that define an actionable notification.

Field Name Description
actionLabel
Field Type
string
Description

Required.

The name of the action seen in the push notification.
actionName
Field Type
string
Description

Required.

Unique identifier of the action in an action group.
actionTarget
Field Type
string
Description
The name of the Apex class where the action is implemented.
actionType
Field Type
NotificationActionType (enumeration of type string)
Description

Type of action.

Required.

Values are:

  • NotificationApiAction: Server-side action where client needs to make action API call.
  • Share: Client-side action where the app shares notification content to any channel.

Declarative Metadata Sample Definition

The following is a definition of a custom notification type that is enabled for desktop and mobile.

1<CustomNotificationType xmlns="http://soap.sforce.com/2006/04/metadata">
2    <customNotifTypeName>Custom Notification</customNotifTypeName>
3    <desktop>true</desktop>
4    <masterLabel>Custom Notification</masterLabel>
5    <mobile>true</mobile>
6</CustomNotificationType>

Wildcard Support in the Manifest File

This metadata type doesn’t support the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.