Use user attributes in message


#1

Hey :wave:

Another question I had:
In messenger I wanted to created reply that will use current user’s attribute, is that possible?

Imagine creating a flow that will generate the following message

Hi {{#first_name}}
Your current plan is {{#plan_name}} do you want to upgrade?

and when I click “Send” the values are populated to fit user’s profile.

Is that even possible?
I could not see how to add attributes in a manual reply, so I doubt it’s doable…

Thanks


#2

Hey - there’s definitely ways to do this, but it really depends on a multitude of reasons. You say in the messenger, but would this be as part of the Messenger App flow? If so, at what stage (ie. after initializing, configuring, submitting etc.) and where? If not, in what context do you want to do this? :slightly_smiling_face:


#3

let me give you more details :slight_smile:

in my configure phase, I am building a card, linking some things to user attributes.

The generated card could look like

Hi {{#first_name}}
Your current plan is {{#plan_name}} do you want to upgrade?
Click here http://linksomewhere.com?acct_id={{#acct_id}}

Then the agent click the “send” button. The message is added to the conversation and ideally variables are changed to user’s values.

This could also happen in Answer bot and all the automated process.

Does it make more sense?


#4

Yeah it does - thanks! It’s not directly linked to a user at this point, but there may be ways to achieve this :+1:

For conversations: In the request to your configure URL, a context object will be sent with the conversation_id. You can make a GET request to the /conversations endpoint to view the conversation, grab the id from the objects in the customers list , and perform another GET request to the /users endpoint to get all details and attributes for the user.

For other locations: At this point, the app is not related to any conversation or user. It’s only when a user interacts with a card (taking a submit action) that we’ll send the user object along with the submit request.