# Creating a notification

> Set up a new notification rule step by step, preview it on a lock screen, and edit, pause or delete rules you already have.

A notification rule takes a minute to set up: pick a trigger, choose any settings it needs, write the message and save. From then on it sends itself.

## Create a rule

1. Go to **Notifications** and click **New notification**.
2. Under **When should this notification be sent?**, choose a trigger. Its description appears underneath, for example "When a customer hasn't scanned in 7 days".
3. Fill in the settings for that trigger (see below).
4. Optional: under **Loyalty card (optional)**, pick one card if this rule should only apply to that card. Leave **All cards** to apply it to every card.
5. Write your **Message**. Click **Insert variable**, or type `{{`, to add the customer's name, their stamp count and so on.
6. Check the **Lock screen notification preview** on the right.
7. Leave **Enabled** ticked to switch it on straight away.
8. Click **Create**.

Not sure which trigger to choose? See [notification triggers](https://docs.getleal.com/notifications/notification-triggers).

## Settings for each trigger

| Trigger | Setting | What to enter |
| ------- | ------- | ------------- |
| **Location-based** | **Location** | One of your locations, or **All locations**. |
| **Location-based** | **Only when customer has an available reward** | Tick to show the message only to customers who have a reward ready. |
| **Stamps milestone** | **Stamp milestone** | The stamp count that triggers it, for example 5. |
| **Inactivity** | **Days of inactivity** | How many days without a scan, for example 30. |
| **Stamps streak** | **Consecutive days** | How many days in a row, 2 or more. |

The other triggers don't need any settings.

## The preview

The **Lock screen notification preview** shows your message as a notification from your store. It fills in variables using one of your real customers and your first location, so you can check the message reads well with real names and numbers.

If you haven't got any customers yet, variables that need a customer show up blank in the preview. Reward variables always show blank in the preview, because they're only filled in when a customer actually reaches a reward.

## Edit, pause or delete a rule

On the **Notifications** page, hover over a rule:

- **Edit** to change the message or settings. Click **Save** when you're done.
- **Disable** to stop it sending without losing it. Click **Enable** to switch it back on.
- **Delete** to remove it for good. You'll be asked to confirm.

You can't change the trigger of the **Stamp earned** and **Stamp redeemed** system rules, or delete them, but you can edit their messages and switch them off. Read [how wallet notifications work](https://docs.getleal.com/notifications/how-wallet-notifications-work#gotchas) before you switch one off.

Changes apply to the next notification that fires. Messages that were already sent aren't changed.

## Errors you might see

- **"has invalid syntax"** on the message. A variable isn't written correctly, usually a missing `}}`. Use **Insert variable** to add variables instead of typing them.
- **"Stamps milestone requires a stamp count greater than 0"** (and similar for inactivity and streaks). Fill in the number for the trigger.
- **"Automated notifications require a Pro plan."** The trigger you chose is Pro only.
- **"You've reached the limit of 2 notification rules."** Free accounts can have 2 rules of their own. Delete or reuse one, or upgrade to Pro.

## Best practices

- Start with one or two rules and watch how customers respond before adding more.
- Limit a rule to one card when the message mentions something specific to that card, such as its reward.
- After creating a rule, test it on your own phone: sign up as a customer, add the pass to your wallet and trigger it.
- Read [writing good notification messages](https://docs.getleal.com/notifications/writing-messages) for tips on wording.
