How to Confirm Inspection Bookings via SMTP from a Booking Webhook
Build a Spojit workflow where a Webhook trigger receives an inspection booking from your website, normalizes the slot and contact details, records the booking in MongoDB, sends a branded confirmation email from your own agency domain, and returns a confirmation reference to the booking page.
What This Integration Does
When a prospective buyer or tenant books a property inspection on your agency website, they expect an instant confirmation that looks like it came from your agency, not from a generic notification service. This workflow turns that booking POST into a complete round trip: it stores the booking so your team has a record, emails the person a branded confirmation from your own domain, and hands a confirmation reference straight back to the booking page so the visitor sees it without a page reload. Everything runs in one synchronous call, so the booking form can show "Confirmed, reference INS-..." the moment the visitor clicks Book.
The run is started by a Webhook trigger: your booking page sends an HTTP POST with the inspection details, Spojit verifies it against a signing connection, and the parsed JSON body becomes the input for the run. A Transform node reshapes the raw form payload into a clean booking record, a Connector node on the mongodb connector inserts that record with insert-documents, a second Connector node on the smtp connector sends the confirmation with send-email, and a Response node returns the reference. Because the webhook returns a real response, the visitor gets the reference synchronously. Each booking is one independent run, so re-posting the same form creates a separate record unless you add deduplication (covered in Tips).
Prerequisites
- A booking page or form that can send an HTTP POST with a JSON body to a URL you configure (most form builders and site backends support a webhook or POST action).
- A Webhook signing connection so Spojit can verify inbound posts. See Setting Up a Webhook Connection for the Spojit, Shopify, GitHub, Slack, or Custom HMAC schemes.
- An SMTP connection to your agency mail server, with a verified default from address on your own domain (for example
inspections@youragency.com). Add it under Connections to Add connection to SMTP. - A MongoDB connection with write access to a database and a collection for bookings (for example database
realestate, collectioninspection_bookings). - The fields your booking page sends: the visitor's name and email, the property reference or address, and the chosen inspection slot (date and time).
Step 1: Add a Webhook trigger to receive the booking
Create a new workflow and add a Trigger node. Set Trigger Type to Webhook and choose your Webhook signing connection. Spojit gives the workflow a unique URL; configure your booking page to POST to it. The trigger output is the parsed JSON body, available as {{ input }}. A typical booking POST looks like this:
{
"name": "Jordan Lee",
"email": "jordan.lee@example.com",
"phone": "+61 400 123 456",
"propertyRef": "PROP-4821",
"propertyAddress": "14 Marine Parade, Bondi",
"slotDate": "2026-07-03",
"slotTime": "10:30",
"timezone": "Australia/Sydney"
}
The webhook responds with 202 and an executionId by default. Because you will add a Response node later, the call instead returns your confirmation payload. For the exact request format and signing behavior, see Setting Up a Webhook Trigger.
Step 2: Normalize the slot and contact details with a Transform node
Add a Transform node after the trigger to turn the raw form fields into a single clean booking record and to mint a confirmation reference. Map the incoming values from {{ input }} into a tidy shape your database and email both reuse. Produce an object like this:
{
"reference": "INS-{{ input.propertyRef }}-{{ input.slotDate }}-{{ input.slotTime }}",
"name": "{{ input.name }}",
"email": "{{ input.email }}",
"phone": "{{ input.phone }}",
"propertyRef": "{{ input.propertyRef }}",
"propertyAddress": "{{ input.propertyAddress }}",
"slotDate": "{{ input.slotDate }}",
"slotTime": "{{ input.slotTime }}",
"timezone": "{{ input.timezone }}",
"status": "CONFIRMED"
}
Trim whitespace and standardize the email to lower case here so the same record drives both the database insert and the email greeting. If you want a guaranteed-unique reference instead of a composed one, add a Connector node on the uuid connector with generate upstream and use that value. Reference this node's output downstream as {{ booking }} (name the output variable booking).
Step 3: Record the booking in MongoDB
Add a Connector node in Direct mode on the mongodb connector and select the insert-documents tool. Direct mode is deterministic, costs no AI credits, and is the right choice for a predictable single insert. Set the fields:
database: your bookings database, for examplerealestate.collection:inspection_bookings.documents: an array with the normalized record from Step 2.
{
"database": "realestate",
"collection": "inspection_bookings",
"documents": [
{
"reference": "{{ booking.reference }}",
"name": "{{ booking.name }}",
"email": "{{ booking.email }}",
"phone": "{{ booking.phone }}",
"propertyRef": "{{ booking.propertyRef }}",
"propertyAddress": "{{ booking.propertyAddress }}",
"slotDate": "{{ booking.slotDate }}",
"slotTime": "{{ booking.slotTime }}",
"timezone": "{{ booking.timezone }}",
"status": "{{ booking.status }}"
}
]
}
The tool returns the inserted document identifiers. Name this node's output variable inserted so you can confirm the write in the execution log. For more on configuring this kind of step, see Using Connector Nodes in Direct Mode.
Step 4: Send a branded confirmation from your own domain with SMTP
Add a second Connector node in Direct mode, this time on the smtp connector, and select the send-email tool. Using the smtp connector (rather than the built-in Send Email node) means the message is delivered through your agency mail server and shows your own domain in the From line, which is what makes the confirmation feel like it came from your agency. Set the fields:
from: leave blank to use the connection default, or set"Inspections <inspections@youragency.com>".to:{{ booking.email }}.subject:Inspection confirmed: {{ booking.propertyAddress }} on {{ booking.slotDate }}.htmlortext: your branded confirmation body, templated with the booking variables.replyTo: an address your team monitors, for exampleinspections@youragency.com.
{
"to": "{{ booking.email }}",
"subject": "Inspection confirmed: {{ booking.propertyAddress }} on {{ booking.slotDate }}",
"html": "<p>Hi {{ booking.name }},</p><p>Your inspection of <strong>{{ booking.propertyAddress }}</strong> is confirmed for {{ booking.slotDate }} at {{ booking.slotTime }} ({{ booking.timezone }}).</p><p>Your reference is {{ booking.reference }}.</p>",
"replyTo": "inspections@youragency.com"
}
The tool returns a send result you can inspect in the log. See the SMTP Email connector article for connection setup and the full field list.
Step 5: Return the confirmation reference to the booking page
Add a Response node as the final step so the synchronous webhook call returns your confirmation payload instead of the default 202 acknowledgement. Return the reference and a short status the booking page can display immediately:
{
"status": "confirmed",
"reference": "{{ booking.reference }}",
"propertyAddress": "{{ booking.propertyAddress }}",
"slotDate": "{{ booking.slotDate }}",
"slotTime": "{{ booking.slotTime }}"
}
Your booking page reads reference from the response and shows "Confirmed, reference INS-..." to the visitor. For the synchronous return mechanics, see Using Response Nodes.
Step 6: Format dates cleanly (optional polish)
Raw slot values like 2026-07-03 and 10:30 read better as "Friday 3 July, 10:30 AM" in the email and on the page. Insert a Connector node on the date connector with the format tool before Step 4, passing the combined slot and the timezone from the booking, then reference its formatted output in the email subject and body. Keep the original machine-readable values in MongoDB so reporting stays sortable, and use the formatted version only for human-facing text.
Step 7: Save, name, and enable the workflow
Give the workflow a clear name such as "Inspection Booking Confirmation", save it, and enable it. Confirm the order on the canvas is Webhook trigger to Transform to mongodb insert to smtp send to Response. If you want help wiring or rearranging nodes, ask Miraxa, the intelligent layer across your automation: for example, "Add a Condition node before the SMTP step that checks if {{ booking.email }} is present and connect the true branch to the send-email node." Miraxa knows the workflow you are editing and will ask first if an instruction is ambiguous.
Tips
- Add a Condition node after the Transform to verify
{{ booking.email }}and{{ booking.slotDate }}are present; route invalid bookings to a Response node that returns a"status": "rejected"so the booking page can prompt for missing fields. - To avoid duplicate records when a visitor double-clicks Book, enable opt-in deduplication on the Webhook trigger via an event-id header carrying a unique booking id from your page.
- Keep the smtp
fromaddress on a domain you control and authenticate; mismatched senders are the most common reason confirmation emails land in spam. - Use the same machine-readable
slotDateandslotTimein MongoDB across all bookings so you can later query upcoming inspections with the mongodbfind-documentsoraggregatetools.
Common Pitfalls
- Timezone drift: store an explicit
timezone(for exampleAustralia/Sydney) and format slot times against it, or visitors in another region see the wrong inspection time. - Webhook signature mismatch: if posts are rejected, confirm the booking page signs the body with the same scheme and secret as your signing connection, and that it sends raw JSON.
- Forgetting the Response node: without it the webhook returns the default
202and your booking page never receives the reference, so the visitor sees no confirmation. - SMTP recipient or auth errors halt the run after the database insert has already happened, leaving a stored booking with no email sent; check the execution log and re-send rather than re-running the whole workflow, which would insert a duplicate record.
Testing
Before pointing your live booking page at the workflow, POST a single test payload to the webhook URL using a sample inspection for a test property and your own email address. Confirm in the execution log that the Transform produced a clean booking object, the mongodb insert-documents step returned an inserted id, the smtp send-email step reported success, and the Response node returned the reference. Check your inbox for the branded confirmation and verify the From line shows your agency domain. Once a single booking works end to end, connect your real booking page and watch the first few live runs in the execution history.