Rule examples

This page is for version 1.1. Read the current version.

For arlanix/notification 1.1.0

Rule examples

These are rules for what stores most often want to know about. To make one, follow Rules. Click Add rule, enter a Name, and choose the Event and the Topic. Then add the conditions and the subject given below. Leave Body empty to use the event's own text, unless the example gives a body.

Make the topic and subscribe people to it first. See Topics.

Some fields are personal data, such as a customer's name. If a subject or a body names such a field, everyone subscribed to the topic gets that data. Send these rules only to topics whose subscribers are allowed to see it.

Sales

Big refunds to accounting

  • Event: Refund
  • Condition: Refunded total equals or greater than 200
  • Topic: Accounting
  • Subject: Refund of {creditmemo.grand_total_formatted} on order #{order.increment_id}

The Refund event has the severity Warning. So a subscription that takes only warnings and errors gets this message.

Orders paid by bank transfer

  • Event: New order
  • Condition: Payment method code is banktransfer
  • Topic: Accounting
  • Subject: Bank transfer to expect: #{order.increment_id}, {order.grand_total_formatted}

Each payment method has its own code. For example, checkmo is Check / Money order. Your developer can tell you the code of another payment method.

Wholesale orders

  • Event: New order
  • Condition: Customer group is Wholesale
  • Topic: Wholesale
  • Subject: Wholesale order #{order.increment_id} from {customer.name||customer.email}: {order.grand_total_formatted}

The subject names the customer, which is personal data.

Orders on hold

  • Event: Order status changed
  • Condition: Status is On Hold
  • Topic: Customer service
  • Subject: Order #{order.increment_id} is on hold, was {order.status_from_label}

Customers and catalog

Customers moved to wholesale

  • Event: Customer group changed
  • Condition: Customer group is Wholesale
  • Topic: Wholesale
  • Subject: {customer.name} moved from {customer.group_from_label} to {customer.group_label}

Reviews to moderate

  • Event: Review to moderate
  • Topic: Catalog
  • Subject: Review of {product.name} to moderate
  • Body: {review.nickname}: {review.title}

The nickname and the review title are personal data. The body sends them.

The contact form to support

  • Event: Contact form
  • Topic: Support, delivered by email
  • Subject: Contact form: {contact.name}, {contact.email}
  • Body: {contact.comment}

Everything in this message is personal data. If you reply to the email, the reply goes to the store's sender address, not to the customer. To answer the customer, write to them from your own mailbox.

Security and the system

Failed sign-ins as admin

  • Event: Admin login failed
  • Condition: Username is admin
  • Severity: Error
  • Topic: Store health
  • Subject: Failed admin sign-in as {admin.username}: {admin.reason}

Many stores have no admin user called admin. Someone who tries this username is guessing.

Sign-ins from a new device

  • Event: Admin logged in
  • Condition: From a new device is Yes
  • Topic: Store health
  • Subject: {admin.username} signed in from a new device
  • Body: From {admin.ip}, {admin.user_agent}.

The IP address and the browser are personal data. After the module is installed, each admin's first sign-in counts as a sign-in from a new device. See Admin sign-ins.

Imports that left rows out

  • Event: Import finished
  • Condition: Errors greater than 0
  • Severity: Warning
  • Topic: Store health
  • Subject: {import.entity_label} import left {import.errors} rows out

Product feeds

A feed that fails, to the team

  • Event: Feed failed
  • Condition: State is Problem
  • Topic: Feed alerts

The event's own text names the feed and the reason it failed. Without the condition, the team also gets an Info message when the feed delivers again. For more feed rules, see Get told when a feed fails.