How to send a push message with variables? (i.e. order number)

How to send a push message with variables? (i.e. order number)

You could send the push via Stella API, so you could include the customer details (i.e.order number) in the template message from your database.

You could also refer to the documentation here on how to Apply Stella API to Chatbot

1. Please use the API to pass the meta object first and then you could use this.agendaMeta to access your meta.

  1. {
  2.  "channelId": "61149207e746725434536d",
  3.  "recipientId": "65874121212",
  4.  "redirect": {
  5.   "tree": "60ff7a60fe961671129234s,
  6.   "nodeCompositeId": "gQEytkyMjZdwR39N"
  7.  },
  8.  "meta": {
  9.   "v1": "FP201121118253",
  10.   "v2": "Furniture polish",
  11.   "imageUrl": "https://image.jpg"
  12.  },
  13.  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJBUEkiLCJhcHAiOiI2MDgyNDJh",
  14.  "headers": {
  15.   "Content-Type": "application/json",
  16.  }
  17. }

2. To apply the variable in the response, please create a preaction in the node that is going to be redirected to save the variable from meta to member Temp Data.


Action for saving the variable to member Temp Data:


  1. return new Promise((resolve) => {
  2.   this.member.botMeta.tempData.v1 = this.agendaMeta.v1
  3.   this.member.botMeta.tempData.v2 = this.agendaMeta.v2
  4.   this.member.botMeta.tempData.imageUrl = this.agendaMeta.imageUrl
  5.   resolve({ member: this.member })
  6. })

3. Custom info saved in Member Temp Data after calling the API

4. After saving the variable in member Temp Data, you could use the following code format in the response to access your Temp Data and send messages with variables to your users.

{{botMeta.tempData.v1}}

{{botMeta.tempData.v2}}

{{botMeta.tempData.imageUrl}}