---
schema_version: "1"
id: 851422cc4e6be5ccc62654abeb19bfa8776eb4f4f9faa1f5501b1d64aa741f12
title: Has Item Context
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/clients/hasItemContext/clients-has-item-context.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/clients-has-item-context.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7db8a683ec94786220e71e8cd2ca302b54011ce488225f289bb242ab2bff99f9
products:
  - Lightning Component Reference
---
# Has Item Context

**`clients:hasItemContext`**

Provides the context information for emails and events. Use this interface to interact with the mail clients.

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

To allow a component to access email or calendar events, implement the `clients:hasItemContext` interface. This interface is used with `clients:availableForMailAppAppPage` to make a component available in Lightning for Outlook or Lightning for Gmail.

The interface has attributes that enable your component to implement record- or context-specific logic.

The source attribute indicates whether the source is an email or appointment. Possible values include `email` and `event`.

The shape of the `people` attribute changes according to the value of the `source` attribute.

When the `source` attribute is set to `email`, the `people` object contains the following elements.

```javascript
{
    to: [ { name: ***nameString***, email: emailString }, ... ],
    cc: [ ... ],
    from: [ { name: senderName, email: senderEmail } ],
}
```

When the source attribute is set to `event`, the `people` object contains the following elements.

```javascript
{
    requiredAttendees: [ { name: ***attendeenameString***, email: emailString }, ... ],
    optionalAttendees: [ { name: optattendeenameString, email: emailString }, ... ],
    organizer: [ { name: organizerName, email: senderEmail } ],
}
```

To ensure that custom components appear correctly in Lightning for Outlook or Lightning for Gmail, enable them to adjust to variable widths.

For more information, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_app_builder_email_app_pane.htm).


:::::

:::::tab
## Attributes

| Name          | Description                                                                                         | Type   | Default | Required |
| ------------- | --------------------------------------------------------------------------------------------------- | ------ | ------- | -------- |
| `messageBody` | Read-only. The body of the current item in plain text                                               | string |         |          |
| `mode`        | Read-only. An enum indicating the mode of the item. Possible values are 'view', 'edit'              | string |         |          |
| `people`      | Read-only. An object representing the contacts on the current item.                                 | object |         |          |
| `source`      | Read-only. An enum indicating where the source is coming from. Possible values are 'email', 'event' | string |         |          |
| `subject`     | Read-only. The subject of the current item.                                                         | string |         |          |

:::::

::::::
