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.

Parent Type 

This type extends Metadata and inherits its fields.

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 

Introduced in API version 46.0.

Fields 

actionGroups 

  • Type: CustomNotificationActionGroup[]
  • Required: No
  • Version: Beta.
  • Description: Optional. Indicates whether mobile action groups are enabled, allowing users to take actions directly from mobile notifications.

customNotifTypeName 

  • Type: string
  • Required: Yes
  • Description: Required. Specifies a notification type name. Maximum number of characters: 80.

description 

  • Type: string
  • Required: No
  • Description: Specifies a general description of the notification type, which is displayed with the notification type name. Maximum number of characters: 255.

desktop 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the desktop delivery channel is enabled (true) or not (false).

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. Specifies the label for the notification type.

mobile 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the mobile delivery channel is enabled (true) or not (false).

slack 

  • Type: boolean
  • Required: No
  • Description: Reserved for future use.

CustomNotificationActionDefinition Type 

CustomNotificationActionDefinition represents the metadata that define an actionable notification.

Fields 

actionLabel 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the action seen in the push notification.

actionName 

  • Type: string

  • Required: Yes

  • Description: Required.

    Unique identifier of the action in an action group.

actionTarget 

  • Type: string
  • Required: No
  • Description: The name of the Apex class where the action is implemented.

actionType 

  • Type: NotificationActionType (enumeration of type string)

  • Required: Yes

  • Description: Type of action.

    Required.

    Values are:

  • Possible values:

    • 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.

CustomNotificationActionGroup Type 

CustomNotificationActionGroup represents the action group.

Fields 

actions 

groupName 

  • Type: string

  • Required: Yes

  • Description: Required.

    Unique name of the mobile action group.

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.