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:
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 panesclients:hasItemContext— provides access to email and event dataclients: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.
Define a
widthattribute:<aura:attribute name="width" type="String"/>
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:
Create a Lightning Out dependency app#
Create a Lightning Out app to allow the component to be loaded outside Salesforce.
Open Developer Console.
Select File > New > Lightning Application.
Enter a name (no spaces or special characters, follow
c:componentNameformat)
Select Lightning Out Dependency App.
Click Submit.
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>
Save the application.
Create a CORS entry#
Allow Revenue Grid to access your Salesforce resources.
Open Salesforce Setup.
In the Quick Find field, enter CORS, and open the page.
Under the Allowed Origins List, click New.
Enter your Revenue Grid tenant URL.
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:
Open Salesforce setup.
Go to Session Settings.
Under Session Settings, enable When embedding a Lightning application in a third-party site, use a session token instead of a session cookie.
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.