Skip to content

Commit

Permalink
Channels-973: parse text field of action buttons (#1738)
Browse files Browse the repository at this point in the history
* feat: parse merge tags in action button text

* chore: added unit test
  • Loading branch information
alfrimpong authored Nov 29, 2023
1 parent 593b024 commit 31e207c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ describe('sendMobilePush action', () => {
expect(responses[0].data).toMatchObject(externalIds[0])
})

it('parses links in tapActionButtons', async () => {
it('parses links and titles in tapActionButtons', async () => {
const title = 'buy'
const body = 'now'
const tapAction = 'OPEN_DEEP_LINK'
Expand All @@ -365,7 +365,7 @@ describe('sendMobilePush action', () => {
tapActionButtons: [
{
id: '1',
text: 'open',
text: 'open{{profile.traits.fav_color}}',
onTap: 'deep_link',
link: 'app://buy-now/{{profile.traits.fav_color}}'
},
Expand Down Expand Up @@ -414,7 +414,7 @@ describe('sendMobilePush action', () => {
tapActionButtons: [
{
id: '1',
text: 'open',
text: 'openmantis_green',
onTap: 'deep_link',
link: 'app://buy-now/mantis_green'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class PushSender extends TwilioMessageSender<PushPayload> {
return {
...button,
onTap: this.getTapActionPreset(button.onTap, button.link),
...(await this.parseContent({ link: button.link }, profile))
...(await this.parseContent({ link: button.link, text: button.text }, profile))
}
})
)
Expand Down

0 comments on commit 31e207c

Please sign in to comment.