Add Forms to Craft CMS with Basin
In this guide, we'll show you how to add a contact form to your Craft CMS site and connect it to Basin.
Basin is a no-code form backend that pairs nicely with CMS platforms like Craft CMS.
Craft CMS is a flexible, user-friendly content management system built on PHP and the Yii framework. It gives developers full control over content modeling, templating with Twig, and front-end markup — making it a popular choice for custom website builds.
By following this guide, you'll have a working contact form on your Craft CMS site that sends you email notifications when visitors submit.
Requirements
You'll need a Basin account, which you can create for free here, and a Craft CMS site. If you don't already have one, you can follow the official Craft CMS installation guide to get started.
You should be comfortable editing Twig templates in your Craft project's templates directory.
Step 1 — Create a form endpoint in Basin
After logging in to your Basin account, create a new form endpoint from the Forms index page. Fill out the fields and click "Create Form".
After your new form endpoint is created, it will appear in your My Forms list. Select it to view the Submissions page, where you can see the inbox, check analytics, and configure integrations and mailer settings.
Copy the form endpoint URL — you'll use it in the next step to connect your Craft CMS form to Basin.
Step 2 — Add a contact form to your Craft CMS template
Open the Twig template where you want to add your form (for example, templates/contact.twig) and add the following HTML form:
<h1>Contact Us</h1>
<form action="https://usebasin.com/f/<YOUR_FORM_ID>" method="POST">
<div>
<label for="name">Name</label>
<input type="text" name="name" id="name" required />
</div>
<div>
<label for="email">Email</label>
<input type="email" name="email" id="email" required />
</div>
<div>
<label for="message">Message</label>
<textarea name="message" id="message" rows="5"></textarea>
</div>
<button type="submit">Send</button>
</form>Replace <YOUR_FORM_ID> with the form endpoint ID you copied from Basin.
Since Craft CMS uses standard HTML in its Twig templates, Basin works out of the box — no plugins or custom PHP required. Just set the form's action attribute to your Basin endpoint URL and you're good to go.
Step 3 — Test your form
Navigate to the contact page on your Craft CMS site, fill out the form, and submit. You should see Basin's default success page, and the submission will appear in your Basin inbox.
From there you can configure email notifications, connect integrations like Slack or Zapier, set up spam filtering, and more — all from the Basin dashboard.
Conclusion
In this guide, you learned how to add a Basin-powered contact form to your Craft CMS site. Since Basin works with standard HTML forms, it pairs perfectly with Craft's Twig templating — no server-side code or plugins needed.
To learn how Basin works with other frameworks and CMS platforms, check out our other step-by-step installation guides.
Happy form building!
Have questions or need help with something specific? Read the docs or get in touch.