Link Surveys to Bookings
How surveys connect to bookings through the automated workflow, access tokens, and email delivery -- and how to test the full flow.
Surveys reach customers through an automated workflow that triggers after a booking is completed. This guide explains how that connection works, what access tokens are, and how to verify everything is functioning correctly.
When to use this
- You have created a survey and configured settings, but want to understand how the email actually gets sent.
- You are troubleshooting why a customer did not receive their survey email.
- You want to understand the security model behind survey links.
- You need to test the end-to-end flow before enabling surveys for real customers.
How the automated workflow works
The survey email is sent by the send_survey_email workflow action. Here is the sequence of events:
1. Booking is completed
When a booking reaches its completed state, the workflow engine evaluates which actions to run.
2. Survey settings are checked
The workflow checks your location's survey settings:
- Is the survey feature enabled? If
Enabledis off, the workflow stops. - Does the booking's activity qualify? If "All Activities" is on, every booking qualifies. If it is off, only activities in the configured activity list trigger surveys.
- Does the customer have an email address? Survey emails require a valid email. If the customer profile has no email, the workflow stops.
3. The correct survey is selected
The system determines which survey to send:
- Activity override: If an activity-specific survey override is configured for the booking's activity, that survey is used.
- Default survey from settings: If the survey settings have a
DefaultSurveyIdset, that survey is used. - Fallback: The system looks for any active survey at the location that has the
IsDefaultflag set to true.
If no survey is found at any of these steps, the workflow stops and logs a warning.
4. A secure access token is generated
The system generates a cryptographically secure, one-time-use access token:
- A 32-byte random value is generated and base64-encoded (URL-safe).
- The token is SHA-256 hashed before storage -- the raw token is never stored in the database.
- The token record links to the survey, the booking, and the location.
- The token expires after the number of days configured in
TokenExpirationDays(default: 30 days).
5. The email is built and sent
The system:
- Loads the email subject and body from your survey settings.
- Replaces template variables (
{{customer.name}},{{company.name}}, etc.) with actual values from the booking and customer. - Wraps the content in the branded HTML email template using your checkout theme colors.
- Inserts a "Take Our Quick Survey" button linking to the unique survey URL.
- Adds review platform links (Google, Yelp, TripAdvisor) if configured.
- Sends the email via the configured mail provider.
- Logs the communication in the communication log for the booking.
6. The delivery is delayed
The email is not sent immediately. It is delayed by the number of hours configured in DelayHours (default: 24 hours). This gives customers time to complete their experience before being asked for feedback.
How access tokens work
Each survey email contains a unique link in the format:
https://survey.resytech.com/s/{token}When a customer clicks the link:
- The system hashes the token from the URL and looks up the matching record.
- It checks three conditions:
- Not expired: The current time is before
ExpiresAt. - Not already used: The
IsUsedflag is false. - Survey is active: The linked survey exists and has
IsActiveset to true.
- Not expired: The current time is before
- If all checks pass, the survey form is displayed, pre-populated with the customer's name and the booking context.
- After the customer submits, the token is marked as used with a timestamp. The link cannot be used again.
If any check fails, the customer sees a specific error message:
| Condition | Message shown |
|---|---|
| Invalid or unknown token | "Invalid or expired survey link" |
| Token has expired | "This survey link has expired" |
| Already submitted | "You have already submitted this survey" |
| Survey deactivated | "This survey is no longer available" |
What the customer sees
When a customer opens a valid survey link, they see:
- Your company logo and location name (branded to match your checkout theme).
- The survey name and description.
- All questions in order, with the appropriate input controls for each type.
- Required questions are marked and enforced -- the form cannot be submitted without them.
- After submission, the configured "Thank You Message" is displayed.
The customer's responses are saved with:
- The full set of answers (keyed by question ID).
- The overall rating (extracted from the first star-rating question).
- Their name and email (from the booking or entered manually).
- A timestamp, IP address, and user agent for auditing.
Testing the full flow
Send a test email
- Go to Marketing > Surveys > Settings.
- In the Send Test Email section, enter your email address.
- Optionally choose a specific survey.
- Click Send Test Email.
The test email arrives immediately (bypassing the delay), has a [TEST] subject prefix, and contains a working survey link. The link expires in 1 day and has no booking attached.
Open the link, fill out the survey, and submit it. Then check the survey's submissions tab in the dashboard to verify your response was recorded.
Verify the workflow connection
If customers are not receiving survey emails, check:
- Survey settings enabled: Go to survey settings and confirm
Enabledis on. - Default survey exists: Ensure a survey is selected as the default, or at least one survey has the "Default" flag.
- Survey is active: The selected survey must have the "Active" toggle on.
- Customer has email: Open the booking's customer profile and verify an email address is present.
- Activity qualifies: If "All Activities" is off, confirm the booking's activity is in the configured list.
- Check timing: Remember the delay. If
DelayHoursis 24, the email will not arrive until 24 hours after booking completion. - Communication log: Check the booking's communication history to see if the survey email was sent and whether any errors occurred.
Tips
- After going live, check the communication log for a few bookings to confirm survey emails are being sent as expected.
- If you change which survey is the default, existing unsent (queued) emails will use the new default. Emails already sent still link to the original survey.
- Tokens are one-time-use by design. If a customer reports they cannot access the survey, check whether the token was already used or has expired.
- The 30-day default expiration balances giving customers enough time while keeping feedback relevant. For time-sensitive businesses, consider reducing to 7-14 days.
Related guides
- Create a Survey -- build the survey form customers will see.
- Configure Survey Settings -- adjust delivery timing, email content, and review links.
- View Survey Responses -- review the feedback customers submit.
- Workflows & Automation -- learn more about the workflow engine that powers survey delivery.
