How to Send Prescription-Ready Pickup Reminders from Your Pharmacy System
Poll your pharmacy management system on a schedule, find the scripts marked ready for collection, and email each customer a branded pickup reminder carrying only their name and pickup code.
What This Integration Does
When a prescription is dispensed and waiting on the shelf, the customer often does not know it is ready until they happen to drop in. This Spojit workflow closes that gap. On a fixed schedule it asks your pharmacy management system which scripts are now marked ready for collection, then sends each of those customers a short, branded reminder email telling them their order is waiting and giving them the pickup code to quote at the counter. It is a pure retail notification: no clinical content, no medication detail, no diagnosis. Only the customer name and the pickup code travel through the workflow, which keeps the reminder safe to automate and easy to reason about.
The run is driven by a Schedule trigger on a 5-field cron, so it fires on its own at the times you choose (for example every weekday morning). Each run reads the current ready-for-collection list from your system through the http connector, reshapes that list with a Transform node, walks it with a Loop node, and sends one email per script. The workflow is stateless between runs: it sends to whoever is on the list at that moment. To avoid emailing the same customer twice, you mark the script as "notified" in your own system (or filter your API call to scripts not yet reminded) so the next run no longer returns them.
Prerequisites
- A pharmacy management system that exposes a REST API returning the queue of scripts ready for collection, including each customer's name, email address, and pickup code. Most modern systems offer this; if yours has no native Spojit tile, you reach it through the http connector, which is the supported pattern for any REST system.
- An API key or token for that system, plus the exact endpoint URL that lists ready scripts.
- A way to send branded email. You can use the built-in Send Email node (no connection needed) for plain reminders, or add a resend connection to send styled HTML from your own pharmacy domain. This tutorial shows both.
- If you use Send Email, confirm external recipients are permitted under Settings -> General -> Email recipients. If you use resend, verify your sending domain first.
- A draft of the reminder copy that mentions only the customer name and pickup code, never the medication.
Step 1: Add a Schedule trigger
Create a new workflow in the Designer and set its trigger to Schedule. A Schedule trigger uses a 5-field Unix cron expression plus an IANA timezone, so reminders go out at a sensible local hour. For a 9am weekday send in Sydney, set the cron to 0 9 * * 1-5 and the timezone to Australia/Sydney. A single trigger can hold several schedules if you want a morning and an afternoon sweep. The trigger output is simply { scheduledAt }; the real data is pulled in the next step.
Step 2: Read the ready-for-collection list with the http connector
Add a Connector node in Direct mode on the http connector and pick the http-get tool. Direct mode is deterministic and costs no AI credits, which is exactly right for a predictable single call. Point the url at your system's ready-scripts endpoint and pass your token in a header.
url: https://api.yourpharmacysystem.com/v1/scripts?status=ready¬ified=false
headers:
Authorization: Bearer YOUR_API_KEY
Accept: application/json
Filtering at the source with something like notified=false is the cleanest way to avoid duplicate reminders. Store the response in an output variable such as readyScripts. If your system returns XML rather than JSON, add a Connector node on the xml connector using to-json before continuing.
Step 3: Reshape the result into a clean list with a Transform node
Most APIs wrap the rows in an envelope (for example {{ readyScripts.data.items }}) and include far more fields than you need. Add a Transform node to pull out just the queue and keep only the three values that should travel: name, email, and pickup code. Map the source array down to a tidy shape like this:
[
{
"name": "{{ item.customer.firstName }}",
"email": "{{ item.customer.email }}",
"pickupCode": "{{ item.pickupCode }}"
}
]
Deliberately dropping medication names, dosages, and any other detail here is what keeps the reminder a retail notification. Save the cleaned array to an output variable such as reminders. If you prefer field-level extraction, you can instead use a Connector node on the json connector with the pick tool to select only those keys.
Step 4: Iterate the scripts with a Loop node
Add a Loop node in ForEach mode and point it at {{ reminders }}. The Loop runs its body once per entry, exposing the current item (for example as {{ loopItem }}) so each iteration has one customer's name, email, and pickupCode. Everything that follows lives inside the Loop body. If your morning queue can be large, keep the body lean: a single email send per iteration is plenty.
Step 5: Send the reminder email
Inside the Loop body, choose one of two ways to email.
Built-in Send Email node. Add a Send Email node, which sends from Spojit's built-in mail service with no connection required. Set Recipients to {{ loopItem.email }}, write a templated Subject and plain-text Body, and set If sending fails to Continue anyway so one bad address does not stop the whole queue.
Subject: Your prescription is ready for pickup
Body:
Hi {{ loopItem.name }},
Your prescription is ready for collection at our pharmacy.
Please quote pickup code {{ loopItem.pickupCode }} at the counter.
See you soon.
resend send-email node (branded, from your domain). To send styled HTML from your own pharmacy address, add a Connector node in Direct mode on the resend connector and pick the send-email tool. Set from to your verified domain address, to to {{ loopItem.email }}, a subject, and an html body. Use reply_to to point replies at your store inbox.
from: Your Pharmacy <reminders@yourpharmacy.com>
to: {{ loopItem.email }}
subject: Your prescription is ready for pickup
html: <p>Hi {{ loopItem.name }},</p>
<p>Your order is ready for collection.</p>
<p>Pickup code: <strong>{{ loopItem.pickupCode }}</strong></p>
reply_to: counter@yourpharmacy.com
Step 6: Mark the script as notified to prevent repeats
Still inside the Loop body, after the email sends, add a second Connector node in Direct mode on the http connector using http-patch (or http-post) to flag the script as reminded in your system. This is what makes the workflow safe to run repeatedly: once a script is marked, your Step 2 filter (notified=false) excludes it next time.
url: https://api.yourpharmacysystem.com/v1/scripts/{{ loopItem.id }}
headers:
Authorization: Bearer YOUR_API_KEY
body:
notified: true
If you keep the pickup-code field in your Transform output, also carry id through so this step has the record reference. If your system has no such flag, store sent codes in a mongodb or mysql connection instead and check against it before sending.
Tips
- Use the timezone field, not a UTC cron, so reminders land at a humane local hour and respect daylight saving automatically.
- Let Miraxa, the intelligent layer across your automation, scaffold the skeleton: try a prompt like "Add a Loop node over
{{ reminders }}and connect its body to a Send Email node that emails{{ loopItem.email }}", then fine-tune fields in the properties panel. - Keep the email body free of medication detail. The Transform node is your guardrail: if a field is not in
reminders, it cannot leak into the message. - For large morning queues, the built-in Send Email node counts toward your monthly email allowance; the resend connector is the better fit at higher volume and lets you brand the message.
Common Pitfalls
- Forgetting to mark scripts as notified means every run re-emails the same customers. Always pair Step 2's filter with Step 6's update, or dedupe against a database.
- If your API paginates the ready list, a single
http-getreturns only the first page. Read the next-page token from the response and loop the fetch, or raise the page size, so no customer is missed. - Reading from an envelope path that does not match your API (for example
data.itemsversusresults) leavesremindersempty and the Loop never runs. Inspect the raw response in the execution logs and adjust the Transform path. - With the built-in Send Email node, external recipients must be on the org allowlist; an unlisted address is rejected. Add your customer domains under Settings -> General -> Email recipients, or send through resend, which has no allowlist.
Testing
Before scheduling it for real, point Step 2 at a test endpoint (or add a temporary filter) that returns a single script whose email is your own. Run the workflow once with the Run button and confirm three things in the execution logs: the readyScripts response shape, that reminders contains only name, email, and pickup code, and that exactly one email arrived with the right code. Then re-run immediately and verify Step 6 marked the script so the second run sends nothing. Once that loop is clean, enable the Schedule trigger and watch the first live run.