Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions apps-script/3p-resources/3p-resources.gs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ function caseLinkPreview(event) {
.setTitle(`Case ${caseDetails["name"][0]}`);
const caseDescription = CardService.newTextParagraph()
.setText(caseDetails["description"][0]);

// Returns the card.
// Uses the text from the card's header for the title of the smart chip.
return CardService.newCardBuilder()
const card = CardService.newCardBuilder()
.setHeader(caseHeader)
.addSection(CardService.newCardSection().addWidget(caseDescription))
.build();

// Returns the link preview smart chip with its dedicated title.
return CardService.newLinkPreview()
.setTitle(`Case ${caseDetails["name"][0]} - caseDetails["description"][0]`)
.setPreviewCard(card);
}
}

Expand Down Expand Up @@ -268,4 +270,4 @@ function createLinkRenderAction(title, url) {
}

// [END add_ons_3p_resources_link_render_action]
// [END add_ons_3p_resources]
// [END add_ons_3p_resources]