@span-studio/craft-yardi-templates
v1.1.3
Published
A custom Yardi scheduler for Craft CMS using Formie and vanilla-calendar-pro
Readme
Craft CMS Yardi Templates
Frontend assets and Twig template partials for the Yardi appointment scheduler used in Craft CMS.
Project Layout
src/js/index.js: scheduler JavaScript entry pointsrc/pcss/: PostCSS and Tailwind stylestemplate/_yardi_scheduler.twig: Twig partial used by Craftdist/: built files published to npm and consumed from CDN
Prerequisites
- Node.js 20.19+ or 22.12+
- npm
Install dependencies from the project root:
npm installBuild The Package
This project uses Vite to generate distributable JS and CSS files in dist/.
Run a production build:
npm run buildThe build writes these publishable assets:
dist/index.es.jsdist/index.umd.jsdist/index.iife.jsdist/index.css- compressed
.gzvariants generated by Vite compression
Before publishing, confirm npm run build completes successfully and review the generated dist/ output if you changed bundle structure, CSS, or public behavior.
Publish To npm
This package publishes only the dist/ directory because package.json limits published files with:
"files": ["dist"]Recommended release workflow:
- Make and review your source changes.
- Run
npm installif dependencies changed. - Run
npm run build. - Bump the package version in
package.json. - Verify what npm will publish.
- Publish from the repository root.
- Update any template or CDN references that pin a specific package version.
1. Bump The Version
Use npm so package.json stays consistent:
npm version patchUse minor or major instead when the change warrants it:
npm version minor
npm version majorIf you do not want npm version to create a git tag or commit automatically, use:
npm version patch --no-git-tag-version2. Preview The Package Contents
Check the tarball contents before publishing:
npm pack --dry-runThis is the fastest way to confirm the built dist/ files are included and nothing unexpected is being shipped.
3. Login And Publish
Authenticate with npm if needed:
npm loginThen publish from this repo directory:
npm publish --access public--access public is important for scoped packages such as @span-studio/craft-yardi-templates.
After Publishing
If downstream Twig templates or CDN includes reference an exact package version, update them to the newly published version. For example, jsDelivr URLs should reference the new tag explicitly when you want deterministic behavior.
Craft Dependencies
Version 1.1.0 requires Craft-side support for secure appointment management links:
span-studio/craft-yardi >= 2.6.0span-studio/craft-formie-yardi-integration >= 1.1.1verbb/formiecompatible with the active Craft major version- Working Craft mail transport for management-link emails
- Persistent Craft cache storage for short-lived management tokens
Form Contract
The scheduler renders the canonical Formie form handle:
{{ craft.formie.renderForm('yardiAppointmentForm') }}Required user/contact field handles remain:
firstNamelastNameemailphone
Required hidden scheduler fields:
apptDateapptTimevoyagerProspectIdvoyagerProspectAppointmentIdappointmentStatus
Recommended hidden scheduler field:
propertyCode
The JavaScript also adds a runtime-only appointmentAction field with either booking or reschedule. This does not need to be configured as a Formie field.
Appointment Management Endpoints
Cancellation and rescheduling use secure email links provided by craft-formie-yardi-integration.
POST /actions/formie-yardi-integration/appointments/request-access
Body:
emailpropertyCodemode:cancelorreschedulemanageUrl- Craft CSRF token when required
The public response should be generic and must not reveal whether matching appointments exist.
POST /actions/formie-yardi-integration/appointments/resolve
Body:
token- Craft CSRF token when required
Successful responses should include only safe appointment summaries:
keyfirstNamelastNameemaildatetimesortValue
POST /actions/formie-yardi-integration/appointments/cancel
Body:
tokenappointmentKey- Craft CSRF token when required
The integration plugin owns server-side lookup of Yardi prospect and appointment identifiers.
Shared Frontend Behavior
The scheduler dispatches completion events on #yardi-appointments:
yardi:appointment-completedyardi:appointment-bookedyardi:appointment-cancelledyardi:appointment-rescheduled
Version 1.1.0 event payloads are privacy-safe. Allowed fields are:
actionisReschedulesubmissionIdwhen available after bookingselectedDateselectedTimecurrentAppointmentwith safe contact and date/time summary data only
Yardi prospect IDs, appointment IDs, raw Formie submission objects, and hidden Yardi fields are intentionally excluded from public events and rendered appointment summaries.
Migration From 1.0.28
- Replace any Client ID / Appointment ID cancellation instructions with the email-link flow.
- Install/update
craft-formie-yardi-integrationto1.1.1or newer. - Ensure
/schedule-tourcan receive links with#manage=<token>. - Add the recommended
propertyCodehidden field for reusable or multi-property deployments. - Update analytics/listeners that expected
prospectIdorappointmentIdin scheduler event payloads.
