Newer Version Available

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

Sample Custom Components for Outlook and Gmail Integration

Review samples of custom Aura components that you can implement in the email application pane for Outlook integration and Gmail Integration.

Apply the Selected Email Context

Here’s an example of a custom Aura component you can include in your email application pane for the Outlook or Gmail integration. This component applies the context of the selected email or appointment.

Display Record Data Based On Recipients

In this example, the custom component displays account and opportunity information based on the email recipients’ email addresses. The component calls a JavaScript controller function, handlePeopleChange(), on initialization.

The Apex controller includes Aura-enabled methods that accept a list of emails as parameters. It queries the Contact and OpportunityContactRoles objects using SOQL and assigns the results to a List variable. You can also modify the example with your own custom objects.

On component initialization, this JavaScript controller calls the helper method, filterEmails(), which builds a list of email addresses from the available people.

The JavaScript controller then makes a call to the server to run the actions to display information. It calls the findOpportunityCloseDateTime method on the Apex controller to query the opportunities days until closing. It calls the findAccountAges method to query the accounts ages.

Once the server returns the values, it sets the appropriate values to display on the client side.

This helper function filters emails from objects.