InboxTemplate
Data class containing the properties for rendering the inbox container, as configured in Adobe Journey Optimizer.
Properties
| Property | Type | Description |
|---|---|---|
heading | The heading text displayed at the top of the inbox. | |
layout | The layout orientation of the inbox ( VERTICAL or HORIZONTAL). | |
capacity | Int | The maximum number of content cards to display in the inbox. |
emptyMessage | The message to display when the inbox is empty. | |
emptyImage | The image to display when the inbox is empty. | |
isUnreadEnabled | Boolean | Whether unread indicators are enabled for content cards. |
unreadBgColor | The background color for unread cards with light and dark theme support. | |
unreadIcon | The icon to display as the unread indicator. | |
unreadIconAlignment | The alignment position of the unread icon on cards. |
Class Definition
Kotlin
Copied to your clipboarddata class InboxTemplate(val heading: AepText,val layout: AepInboxLayout,val capacity: Int,val emptyMessage: AepText? = null,val emptyImage: AepImage? = null,val isUnreadEnabled: Boolean = false,val unreadBgColor: AepColor? = null,val unreadIcon: AepImage? = null,val unreadIconAlignment: Alignment? = null)
AepInboxLayout
Enum representing the layout orientation of the inbox.
| Value | Description |
|---|---|
VERTICAL | Cards are displayed in a vertical scrolling list (LazyColumn). |
HORIZONTAL | Cards are displayed in a horizontal scrolling list (LazyRow). |
Usage Example
Kotlin
Copied to your clipboardwhen (val state = inboxUIState) {is InboxUIState.Success -> {val template = state.template// Access inbox configurationval headingText = template.headingval isVertical = template.layout == AepInboxLayout.VERTICALval maxCards = template.capacityval showUnreadIndicators = template.isUnreadEnabled// Check if inbox is emptyif (state.items.isEmpty()) {// Display template.emptyMessage and template.emptyImage}}}
