In "Response / Script", you can execute any script (program). By using scripts, you can link with external systems to provide reservation functions and freely refer to and update HubSpot data.
Enter the keyword "// script" in the first line of the auto-responder response. This will cause the response to be interpreted as a script.
You can edit the script in a large window by clicking the "Edit in Editor" button at the bottom of "Response Contents / Script".
We have prepared some useful variables and functions that can be used in scripts.
- Variables
- reply
Refers to the message sent by your LINE friend.
- reply
- Function
- lh.sendMessage
Sends a message to a LINE friend. - lh.updateContact
Update a LINE friend's contact properties. - lh.addMultipleCheckboxValue
Add to LINE friends' contact properties. - lh.removeMultipleCheckboxValue
Deletes the value of a LINE friend's contact property.
- lh.sendMessage
The following is a sample script.
// script
// send a message
lh.sendMessage("Your phone number has been accepted.") ;
// Update the HubSpot contact properties
lh.updateContact("phone", reply);
//Add to HubSpot contact properties
lh.addMultipleCheckboxValue("phone", reply);
//Delete HubSpot contact property values
lh.removeMultipleCheckboxValue("phone", reply);
It will respond based on the message received by the auto-responder, and
The sent message is stored in the contact's phone number property.
*"lh.addMultipleCheckboxValue" can only be used for properties that allow multiple values to be set.
Next: Update contacts by bot response