Configure Aura components for Context Panel#

Configure an Aura component so Revenue Grid can load it in the Context Panel and pass data to it.

This guide walks you through the required configuration steps.

The examples in this guide use a sample component for illustration. Update component names, attributes, and logic to match your implementation.

Prerequisites#

Before you begin, ensure the following:

  • An Aura component is created and available in your Salesforce org.

  • Revenue Grid is set up and connected to your Salesforce org.

  • You have System Administrator permissions in Salesforce.

Configure the component#

Configure the Aura component so it can be used in the Context Panel and receive data:

  1. Make the component available for Outlook and Gmail

  2. Expose integration attributes

  3. Make the component responsive to width

Important

After updating the component, deploy the changes to your Salesforce org before proceeding with the integration steps.

Make the component available for Outlook and Gmail#

Add required interfaces to the component so it can be used in email applications and receive context data.

  • clients:availableForMailAppAppPage — enables the component in email application panes

  • clients:hasItemContext — provides access to email and event data

  • clients:hasEventContext — provides additional event-specific data

Example:

<!-- itemProperties.cmp -->

<aura:component
    access="global"
    implements="clients:availableForMailAppAppPage,
                clients:hasItemContext,
                clients:hasEventContext,
                force:appHostable,
                flexipage:availableForAllPageTypes">
</aura:component>

Expose integration attributes#

Define attributes to receive context data from Context Panel.

These attributes provide information about the current email or event (for example, source, subject, or participants).

For the full list of supported attributes, see Integration attributes for Aura components.

Example:

<aura:component
    access="global"
    implements="clients:availableForMailAppAppPage,
                clients:hasItemContext,
                clients:hasEventContext,
                force:appHostable,
                flexipage:availableForAllPageTypes">

    <!-- Attributes receive context data from Revenue Grid -->
    <!-- Replace or extend these attributes based on your use case -->
    <aura:attribute name="source" type="String"/>
    <aura:attribute name="mode" type="String"/>
    <aura:attribute name="subject" type="String"/>
    <aura:attribute name="messageBody" type="String"/>
    <aura:attribute name="dates" type="Object"/>
    <aura:attribute name="location" type="String"/>

</aura:component>

You can reference these attributes in the component markup:

<!-- itemProperties.cmp -->

<aura:component
    access="global"
    implements="clients:availableForMailAppAppPage,
                clients:hasItemContext,
                clients:hasEventContext,
                force:appHostable,
                flexipage:availableForAllPageTypes">

    <aura:attribute name="source" type="String"/>
    <aura:attribute name="mode" type="String"/>
    <aura:attribute name="subject" type="String"/>
    <aura:attribute name="messageBody" type="String"/>
    <aura:attribute name="dates" type="Object"/>
    <aura:attribute name="location" type="String"/>

    <div>
        <!-- Example usage of context attributes passed from Context Panel -->
        <!-- Replace this markup with your component UI and logic -->
        <p><b>Source:</b> {!v.source}</p>
        <p><b>Mode:</b> {!v.mode}</p>
        <p><b>Subject:</b> {!v.subject}</p>
        <p><b>Message Body:</b> {!v.messageBody}</p>
        <p><b>Event Date:</b> {!v.dates}</p>
        <p><b>Event Location:</b> {!v.location}</p>
    </div>

</aura:component>

Make the component responsive to width#

Ensure the component adapts to the Context Panel layout.

  1. Define a width attribute:

    <aura:attribute name="width" type="String"/>
    
  2. Add lightning:flexipageRegionInfo:

    <lightning:flexipageRegionInfo width="{!v.width}"/>
    

Example:

<aura:component
    access="global"
    implements="clients:availableForMailAppAppPage,
                clients:hasItemContext,
                clients:hasEventContext,
                force:appHostable,
                flexipage:availableForAllPageTypes">

    <!-- Provided by the container (Salesforce page or Context Panel) -->
    <!-- Use this value to adjust layout based on available width -->
    <aura:attribute name="width" type="String"/>
    <lightning:flexipageRegionInfo width="{!v.width}"/>

</aura:component>

Context Panel passes width information to the component, allowing it to adjust its UI.

Enable integration with Revenue Grid#

Configure Salesforce settings required for Revenue Grid to load and display the component in the Context Panel:

  1. Create a Lightning Out dependency app

  2. Create a CORS entry

  3. Request integration activation

Create a Lightning Out dependency app#

Create a Lightning Out app to allow the component to be loaded outside Salesforce.

  1. Open Developer Console.

    ../../../../_images/DeveloperConsole.webp
  2. Select File > New > Lightning Application.

    ../../../../_images/NewLightningApp.webp
  3. Enter a name (no spaces or special characters, follow c:componentName format)

    ../../../../_images/AppName.webp
  4. Select Lightning Out Dependency App.

    ../../../../_images/DependencyAppCheck.webp
  5. Click Submit.

  6. Update the application:

    • Add access="GLOBAL" to <aura:application>

    • Add a dependency:

      <aura:application extends="ltng:outApp" access="global">
          <!-- Allows Revenue Grid (Lightning Out) to load this component -->
          <!-- Replace c:itemProperties with your component name -->
          <aura:dependency resource="c:itemProperties"/>
      </aura:application>
      
  7. Save the application.

Create a CORS entry#

Allow Revenue Grid to access your Salesforce resources.

  1. Obtain your Revenue Grid tenant URL.

  2. Open Salesforce Setup.

  3. In the Quick Find field, enter CORS, and open the page.

  4. Under the Allowed Origins List, click New.

    ../../../../_images/NewCORS.webp
  5. Enter your Revenue Grid tenant URL.

    ../../../../_images/TenantURL.webp
  6. Click Save.

Request integration activation#

After completing the configuration, contact Revenue Grid Support and provide:

  • Component title to be displayed in the Context Panel (up to 10 characters to avoid truncation)

  • Component icon (Base64 data: URL)

  • Lightning dependency app name (for example, c:lightningOutForRG)

  • Lightning web component name (for example, c:itemProperties)

After activation, refresh Context Panel to display the component.

Optional: enable token-based authentication (MacOS)#

To ensure compatibility with Safari:

  1. Open Salesforce setup.

  2. Go to Session Settings.

  3. Under Session Settings, enable When embedding a Lightning application in a third-party site, use a session token instead of a session cookie.

    ../../../../_images/SessionSettings.webp
  4. Save changes.

If not enabled, Context Panel may fail to load the component with the following error: “Failed to load lightning component within timeout. Please check its configuration.”

For more details, see Microsoft’s guide on cross-site tracking.