How to Build a Refill-Pickup Reminder Desk from Mailhook Intake Forms

Turn the pickup-ready notices your retail pharmacy system emails into structured records and friendly customer reminders, with every action logged in your Front support desk, all on a Spojit Mailhook workflow.

What This Integration Does

Retail pharmacies generate a steady stream of "ready for pickup" notices: the store system sends a short email naming the customer and a pickup code whenever an order is filled and waiting at the counter. Re-keying those notices by hand into your records, then remembering to nudge each customer, is slow and easy to drop. This Spojit workflow takes the notice the moment it lands, reads the customer name and pickup code out of the message body into a clean record, posts that record to your pharmacy system's REST API, sends the customer a short pickup reminder, and logs the whole thing as a Front conversation so your front-desk team has a single audit trail. It is purely a retail reminder and admin task: no clinical content, no medical advice, just "your order is ready, here is your code."

The workflow is started by a Mailhook trigger. You point your store system (or a forwarding rule) at a unique Spojit address, and any mail to that address starts a run within seconds. There is no mailbox to connect and no polling delay. Each run reads the incoming email from {{ input }}, extracts a structured record with a Connector node in Agent mode using a Response Schema, branches on whether the extraction succeeded with a Condition node, posts the record with the http connector, then emails the customer and logs the interaction. Runs are independent and deduplicated per message, so the same notice arriving twice will not double-send. Because the trigger is async, there is no reply to the original sender: the customer reminder is a fresh outbound message addressed from the extracted record.

Prerequisites

  • A Spojit workspace where you can create workflows and add a Mailhook trigger.
  • Your retail pharmacy system's REST API base URL and an API key (or token) you can pass in an Authorization header. Spojit reaches it through the http connector, so no native tile is required.
  • A Resend connection (API key) with a verified sending domain, so reminders go out from your own pharmacy address.
  • A Front connection (API key) and the channel ID of the support channel you want to log into. You can find channel IDs with the Front list-inboxes tool or in your Front admin settings.
  • The customer email address must reach you somehow: either the store notice includes it, or you look it up. This tutorial assumes the notice includes the customer email and name plus a pickup code.
  • External reminder recipients must be allowed by your store's normal email policy; Resend sends from your verified domain, so no Spojit recipient allowlist applies to this connector.

Step 1: Create the Mailhook trigger and capture the notice

Create a new workflow and add a Trigger node. Set Trigger Type to Mailhook. Optionally set an Address prefix such as pickup (1-24 characters), then click Generate email address. Spojit produces a unique address like pickup-3f9a2b7c1d4e6f80@mailhook.spojit.com. Copy it and configure your retail pharmacy system (or a mail forwarding rule on the address that currently receives pickup notices) to send those notices there.

To keep stray mail out, set the optional From allowlist to the address your store system sends from, and a Subject regex such as (?i)ready for pickup so only pickup-ready notices start a run. Once live, every matching email exposes its contents at {{ input }}, including {{ input.subject }}, {{ input.text }}, {{ input.from }}, and {{ input.replyTo }}.

Step 2: Extract the customer name and pickup code with an Agent-mode Connector node

Add a Connector node and switch it to Agent mode. Agent mode lets the agent read the free-text notice and return a clean record, which is far more reliable than fixed string parsing when the store's wording varies. Give it a focused prompt that reads from the trigger:

You are reading a retail pharmacy "ready for pickup" notice.
From the email below, extract the customer's full name, the
customer's email address, and the pickup code exactly as written.
This is a retail pickup reminder only. Do not infer or add any
clinical or medical detail.

Subject: {{ input.subject }}
Body:
{{ input.text }}

Turn on the Response Schema so the output is forced into structured JSON you can map downstream. Use a schema like this:

{
  "type": "object",
  "properties": {
    "customerName":  { "type": "string" },
    "customerEmail": { "type": "string" },
    "pickupCode":    { "type": "string" },
    "found":         { "type": "boolean" }
  },
  "required": ["found"]
}

Set the node's Output Variable to record. Ask the agent to set found to false when the message is not a real pickup notice or a field is missing, so the next step can branch cleanly. Downstream you reference {{ record.customerName }}, {{ record.customerEmail }}, and {{ record.pickupCode }}.

Step 3: Branch on a clean extraction with a Condition node

Add a Condition node so you only act on notices that parsed cleanly. Configure the condition to check that {{ record.found }} is true and that {{ record.pickupCode }} is not empty. Connect the true output to Step 4 (post the record), and leave the false output to a Send Email node that alerts your team to review the notice by hand. For the false branch, a quick Send Email to your front-desk inbox with the raw {{ input.subject }} and {{ input.text }} is enough to make sure nothing is silently dropped.

Step 4: Post the record to your pharmacy system with the http connector

On the true branch, add a Connector node on the http connector in Direct mode and pick the http-post tool. Point it at your retail pharmacy system's REST API and pass your API key in the headers. This is the supported pattern for any system without a native Spojit tile.

URL: https://api.your-pharmacy-system.com/v1/pickups
Headers:
  Authorization: Bearer YOUR_API_KEY
  Content-Type: application/json
Body:
{
  "customerName": "{{ record.customerName }}",
  "customerEmail": "{{ record.customerEmail }}",
  "pickupCode": "{{ record.pickupCode }}",
  "status": "ready",
  "source": "mailhook",
  "receivedAt": "{{ input.receivedAt }}"
}

Set the node's Output Variable to posted so you can reference the API response (for example a created record id) in later steps and in your logging.

Step 5: Send the customer a friendly pickup reminder with Resend

Add a Connector node on the Resend connector in Direct mode and pick the send-email tool. Resend sends from your own verified pharmacy domain, which is why it is preferred here over the built-in Send Email node for the customer-facing message. Map the fields to the extracted record:

from:    Pharmacy Pickup Desk 
to:      {{ record.customerEmail }}
subject: Your order is ready for pickup
html:    

Hi {{ record.customerName }},

Good news, your order is ready to collect at the counter. Please bring your pickup code: {{ record.pickupCode }}.

See you soon!

Keep the copy purely retail and logistical: it confirms the order is waiting and gives the code. Do not include any clinical or treatment wording. Set the Output Variable to reminder so the send result is available for logging.

Step 6: Log the interaction in Front

Add a Connector node on the Front connector in Direct mode and pick the send-message tool to record the interaction as a conversation in your support channel. Provide the channelId of your logging channel, the recipient handle in to, a subject, and an HTML body that summarizes what happened:

channelId: cha_your_channel_id
to:        ["{{ record.customerEmail }}"]
subject:   Pickup reminder sent - {{ record.pickupCode }}
body:      

Pickup-ready notice processed for {{ record.customerName }}.

Code: {{ record.pickupCode }}
Reminder emailed: yes
System record: {{ posted.id }}

This gives your front-desk team a searchable Front conversation for every reminder, so they can answer "did the customer get notified?" without digging through the store system. If you would rather tag these conversations, follow this send-message with the Front add-tag tool on the returned conversation.

Tips

  • Use a tight Subject regex on the Mailhook trigger so marketing mail or replies never start a run. Pair it with the From allowlist set to your store system's sending address.
  • Keep the Agent-mode prompt narrow: ask only for name, email, and code. A shorter task means cheaper, faster, more consistent extraction.
  • If your store notice does not include the customer email, post the record in Step 4 first, then look the email up from the API response before the Resend step.
  • Reference the store record id ({{ posted.id }}) in both the Resend and Front messages so a single pickup is traceable end to end.

Common Pitfalls

  • Mailhook runs are async, so there is no reply to the sender. The customer reminder must be a fresh message to {{ record.customerEmail }}, not a reply to {{ input.replyTo }}.
  • If the Agent node returns found: false but you skip the Condition node, you will post empty records and email no one usefully. Always branch on {{ record.found }}.
  • Front send-message needs a real channelId, not an inbox name. Look it up once with list-inboxes and store it.
  • Resend will reject mail from an unverified domain. Verify your sending domain in Resend before going live, or the customer reminder step fails.
  • Keep all copy on the retail side of the line: a pickup reminder confirms an order is waiting and never gives medical or treatment guidance.

Testing

Before pointing your live store system at the address, send yourself a test email to the Mailhook address that mimics a real pickup notice (a customer name, a fake email you control, and a pickup code). Run the workflow and open the execution in Spojit: confirm the Agent node's record output has the right name, email, and code, that the Condition node took the true branch, that http-post returned a success status, that you received the Resend reminder at your test address, and that a Front conversation appeared in your logging channel. Once a handful of sample notices pass, set the From allowlist to your store system and switch it on for real traffic.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.