Self-hosted, for Craft Commerce 5
Lifecycle marketing that runs on your own server
Thank-you emails, review requests, replenishment reminders, win-backs and abandoned carts, written as rules in the control panel: when something happens, only if these conditions hold, then do these steps in order, each after its own delay. Your customer data stays in your Craft database, and nothing is billed per contact.
Email bodies are Twig
Subjects and bodies render against the run's payload: contact, order, user, workflow, stats, unsubscribeUrl, and cartRestoreUrl for abandoned carts. A step an admin wrote gets the real Commerce objects. A step anyone else wrote renders in Craft's Twig sandbox against plain data, where order.totalPriceAsCurrency stands in for the commerceCurrency filter.
Hi {{ contact.firstName ?? 'there' }},
Your order {{ order.reference }} for {{ order.totalPrice|commerceCurrency(order.currency) }}
is on its way.
{% if stats.orderCount > 1 %}Thanks for coming back.{% endif %}
<a href="{{ unsubscribeUrl }}">Unsubscribe</a>
Features
A rules engine over Commerce events, with the guarantees you want before it is allowed to email your customers.
When, only if, then
A workflow is a trigger, a set of conditions and an ordered list of steps, each with its own delay before it runs. Ten triggers, twenty-eight conditions and fourteen actions ship with it.
- Rules in a group must all match; any one group matching is enough
- Conditions are checked again before every step, not only at the start
Nothing fires twice
Every run carries a deduplication key, and a unique database index on the workflow and that key is the guarantee. A retried webhook, a Commerce event that fires twice or an overlapping sweep collides there and is dropped.
- After a queue outage, a step far past its time is recorded as abandoned instead of sent late
A simulator that uses the engine
Pick a real order or contact and see, rule by rule, which workflows would run and why the others would not. It calls the same methods a live run does, with a simulate flag, so what it shows is what the engine would do.
- Also on the command line: php craft lyfe/workflows/simulate <orderId>
- Dry run per workflow or site-wide records everything and sends nothing
Consent with a paper trail
Lyfe keeps its own contacts, keyed on lowercase email, because most Commerce customers never register. Each carries tags, a phone number and separate email and SMS subscription flags. An unsubscribed contact is never marketed to, and the message log records the refusal.
- Build contacts from existing orders with php craft lyfe/contacts/backfill
Fourteen presets, all switched off
The common lifecycle flows, from a review request two weeks after completion to a daily scan for customers who have been quiet for 120 days. Each installs disabled, with its placeholder copy marked EDIT ME, so adding a preset never emails anybody.
Abandoned carts and win-backs
Pro tracks cart activity, marks a quiet cart abandoned and gives each email a link that puts the cart back in the customer's session. Scheduled contact scans walk your contacts on a timer, which is how a workflow notices somebody who has simply stopped buying.
- Recovered carts and their value are summarised in the control panel
- One-off, expiring discount codes when a nudge needs one
SMS without an SDK
Pro sends SMS through Twilio, which is one authenticated form POST, so Lyfe makes it directly rather than adding a dependency tree. A generic HTTP transport posts to any other gateway, and Sms::EVENT_REGISTER_TRANSPORTS takes your own.
Checkout comes first
Every listener that runs in a customer's request is wrapped on its own, and a failure is logged rather than raised. Steps run from cron or a throttled queue job, never inline, so an automation cannot slow down or stop somebody paying.
Frequently Asked Questions
The questions worth answering before you install it.
There are two editions and both are paid. Lite is $99 and is the whole engine: every order and account trigger, every condition, multi-step workflows with delays, email, tags, order notes, webhooks, the simulator and the logs. Pro is $179 and adds what needs standing infrastructure: cart tracking, scheduled scans, SMS, discount codes, order-status and user-group actions, send windows, per-contact run limits and cooldowns, tag chaining, and cancelling another workflow's pending runs.
Not unless a step sends it. Contacts, runs and messages are tables in your Craft database, and conditions are checked against Commerce in PHP. Data leaves only through what you configure: your mailer, an SMS gateway, or a webhook step.
It is the intended setup. One entry, * * * * * /path/to/project/craft lyfe/run/due, advances due steps, sweeps abandoned carts and runs scheduled scans. Without cron, turn on Also process during web requests in the settings, which pushes a throttled queue job instead. It never runs inline in a customer's request.
Lyfe checks the conditions again before every step, so a review request due twelve days after the order looks at the order and the contact once more before it sends. A Stop if step ends the run outright, for example once the customer has already bought.
Yes, with limits. Each step records whether an admin last wrote it. An admin's step renders Twig as written; anyone else's renders in Craft's Twig sandbox against plain data, or, with the sandbox off, cannot contain Twig at all. Webhook steps are admin-only. A marketer can reorder, retime, pause or enable an admin's workflow, and a step they leave untouched stays trusted. A step a marketer writes stays sandboxed until an admin reads it and ticks Approve, and saving the workflow alone never trusts it.
A workflow that uses Pro features refuses to start, and the reason goes into the log. It does not keep running with its Pro steps quietly skipped.
Yes. Each is a registry keyed by a stable handle, with an event for adding your class: Types::EVENT_REGISTER_TRIGGERS, EVENT_REGISTER_RULES and EVENT_REGISTER_ACTIONS, plus Sms::EVENT_REGISTER_TRANSPORTS. The handle is what gets stored, so your class can move without a migration.
Craft CMS 5.3+, Craft Commerce 5.0+, PHP 8.2+.
Lite runs the engine, Pro runs the infrastructure
Lite is $99: every order and account trigger, every condition, email, tags, webhooks and the simulator. Pro is $179 and adds abandoned carts, scheduled scans, SMS, discount codes, send windows and run limits.