Newer Version Available

This content describes an older version of this product. View Latest

QuickActionDefaultsHandler Interface

The QuickAction.QuickActionDefaultsHandler interface lets you specify the default values for the standard Email Action on Case Feed. You can use this interface to specify the From address, CC address, BCC address, subject, and email body for the Email Action in Case Feed. You can use the interface to pre-populate these fields based on the context where the action is displayed, such as the case origin (for example, country) and subject.

Namespace

QuickAction

Usage

To specify default values for the standard Email Action on Case Feed, create a class that implements QuickAction.QuickActionDefaultsHandler.

When you implement this interface, provide an empty parameterless constructor.

QuickActionDefaultsHandler Methods

The following are methods for QuickActionDefaultsHandler.

onInitDefaults(actionDefaults)

Implement this method to provide default values for the standard Email Action in Case Feed.

Signature

public void onInitDefaults(QuickAction.QuickActionDefaults[] actionDefaults)

Parameters

actionDefaults
Type: QuickAction.QuickActionDefaults[]
This array contains only one item of type QuickAction.SendEmailQuickActionDefaults.

Return Value

Type: void

QuickActionDefaultsHandler Example Implementation

This is an example implementation of the QuickAction.QuickActionDefaultsHandler interface.

In this example, the onInitDefaults method checks whether the element passed in the array is for the standard Email Action on Case Feed. Then, it performs a query to retrieve the case that corresponds to the context ID. Next, it sets the value of the BCC address of the corresponding email message to a default value. The default value is based on the case reason. Finally, it sets the default values of the email template properties. The onInitDefaults method determines the default values based on two criteria: first, whether a reply action on an email message initiated the call to the method, and second, whether any previous emails attached to the case are associated with the call.