Use Grant automatically on the programme for Rent on time, New lease, Move in, Renewal, Tenure milestone, and Birthday. For Custom, One time, and Referral — or any occasion Yorlet does not grant for — create a workflow that runs Grant loyalty points.
Prerequisites
- Loyalty enabled, and a programme to grant from. Custom, One time, and Referral have no Grant automatically switch.
- Workflows enabled. Grant loyalty points only appears in Add a step when Loyalty is on.
Do not add a workflow for an occasion that already has Grant automatically on, or customers can be rewarded twice.
Create the programme
To create a programme to grant from a workflow, follow these steps:
- Go to Loyalty programmes.
- Click New programme.
- Set Type to Custom, One time, or Referral.
- Set Reward points.
- Click Create.
See Programmes for every field.
Create the workflow
To grant that programme from a workflow, follow these steps:
- Go to the Workflows page and click New workflow.
- Click Workflow name and enter a name, for example “Grant welcome points”.
- Select Trigger and choose a Trigger type. See Triggers and the recipes below.
- Click Add step, open Loyalty, and choose Grant loyalty points.
- Set Loyalty programme to the programme you created.
- Set Recipient type to Customer. Set Recipient with Insert variable. This defaults to
{{ trigger.object.customer }} when the trigger has a customer. Inside a For each, use {{ loop.item.id }}.
- Leave Points blank to use the programme reward, unless this run should override it.
- Click Publish.
Only Active workflows run. See Create a workflow.
Choose a trigger
Grant every customer on a tenancy or application
If the trigger has a list of customers, add For each after the trigger:
- Set Array to
{{ trigger.object.customers }}.
- On the Each item branch, add Grant loyalty points.
- Set Recipient to
{{ loop.item.id }}.
A loop can run for at most 50 items. See Conditions and loops.
Only grant for some records
Add If / else after the trigger if you only want the workflow to continue for some records — for example an amount threshold, a building, or an application type. See Conditions and loops.
Check it ran
Open the workflow and look at Recent runs. Failed grants — for example no matching resident, or an archived programme — show on the run. See Runs.
Custom programme when a contract is completed
To grant a custom programme when a contract is completed, follow these steps:
- Create a Custom programme with the points you want to award.
- Create a workflow named, for example, “Grant points when a contract is completed”.
- Set Trigger type to Database event and Event to
contract.completed.
- Add Grant loyalty points. Set Loyalty programme to that programme, Recipient type to Customer, and Recipient to
{{ trigger.object.customer }}.
- Click Publish.
Points for every customer on a tenancy
To grant points to every customer on a tenancy, follow these steps:
- Create a Custom programme.
- Create a workflow with a Database event trigger that has
customers on the record — for example tenancy.activated, but only if you do not also have Grant automatically on a Move in programme.
- Add For each with Array
{{ trigger.object.customers }}.
- On the Each item branch, add Grant loyalty points with Recipient
{{ loop.item.id }}.
- Click Publish.
Grant from another system
To let another system start the grant from the Dashboard, follow these steps:
- Create a Custom programme.
- Create a workflow and set Trigger type to API request.
- Click Add under Input parameters. Set the key to
customer, the type to String, and turn on Required.
- Add Grant loyalty points. Set Recipient type to Customer and Recipient to
{{ trigger.input.customer }}.
- Click Publish.
Your systems then call POST /v1/workflows/:id/trigger with { "input": { "customer": "cus_..." } }.
If you already call Yorlet from a server with a secret key, you can POST /v1/loyalty/program_events instead. See Grant loyalty rewards from your systems.
Treat Referral like Custom: you choose the recipient. Yorlet does not record who referred whom.