In NowGo’s customer communication module you can customise SMS messages, emails and tracking page copy updates to include dynamic information. This allows communications to include copy like a customer’s name or when a delivery was completed.
To include this dynamic information in your communications, NowGo uses something called handlebars notation, which looks like this: {{example}}
.
For example:
“Hi {{consignment.receiver.name}}, your package from {{consignment.sender.business_name}} was delivered at {{format-time completion.deliver.location_time}}.”
This results in the customer seeing, “Hi Jennifer Lee, your package from BBQ’s R Us was delivered at 3:35pm today.”
Summary
As a general rule, handlebars notation allows access to an object's data using the same path as the NowGo API https://docs.nowgo.io/, using the below syntax:
path
below refers to the path as described in the API, such as receiver.name
in a consignment object.
Consignment data: {{consignment.path}}
Note that you can only access consignment data if the communication plan is set on the consignment, not on the job.
Stop data: {{action.path}}
, where action
is the external reference of the action of the relevant stop.
Workflow completion data: {{completion.action.path}}
, where the action
external reference is used to reference the most recent relevant workflow completion.
Stop completion data: {{stopcompletion.action.path}}
, where the action
external reference is the action of the relevant stop.
Tracking link: {{tracking_link}}
, to include the tracking page link.
Consignment information
At the moment, consignment information can only be accessed if the communications plan was specified on a consignment, rather than a job.
To access information from the consignment related to the plan, use ‘Consignment’, followed by the hierarchical path as shown in the API https://docs.nowgo.io/#consignments7.
For example, to show the receivers name in a message, you can include {{Consignment.receiver.name}}
.
Stop and stop completion information
NowGo uses actions to determine what stop to get information from. For example, the action external reference “deliver” would access the next upcoming relevant stop with that action. If there are no upcoming stops, it tries to match the most recent.
The syntax is {{action.path}}
, path
being the path as described in the API https://docs.nowgo.io/#stops. For example, to show the address of an upcoming pickup stop, you would use {{pickup.location.address}}
.
To access the stop completion information for a stop, add the prefix stopcompletion
. For example, {{stopcompletion.deliver.time}}
.
If the communications plans is set on a job, stops part of that job are considered within scope. If plans are set on a consignment, stops on which the consignment has target articles will be in scope.
Workflow completion information
NowGo uses actions to determine what workflow completion to get information from. So, for example, the action external reference “deliver” would access the most recent relevant workflow completion with that action.
The syntax is {{completion.action.path}}
, path
being the the path described in the API https://docs.nowgo.io/#workflow-completions21. For example, to show the time of the latest deliver workflow completion, you would use {{Completion.deliver.location_time}}
.
Formatting time
Time data is not suitable for customers in its raw state, so NowGo has a helper you can use to format time values.
For time/date values such as the pickup workflow completion location_time
, you can use {{format-time completion.pickup.location_time}}
. This shows time as hh:mma dd/MM/yyyy
by default, for example 12:42pm 10/12/2024
.
The format can be customised. For example, to just show the time:
{{format-time completion.pickup.location_time format=”hh:mma”}}
This shows as 12:42pm
.
The syntax that can be used inside of format=”syntax”
includes:
hh
= clock hours (1-12), HH = 24 hour time hours (00-23)mm
= minutes of the houra
= PM or AMyyyy
oryy
= year (2021 or 21)M
= month of the year. (M = 7, MM = 07, MMM = Jul, MMMM = July)d
= day of month (d = 2, dd = 02)E
= day of week (E = Tue, EEEE = Tuesday)
Missing data
When there is no data, NowGo leaves the space blank as to not show any errors or confusing text to the consumer.