All projects

Project

Form Sender

Send email from any website form, with no back end to write.

  • Email API
  • Laravel
  • Open source

What it is

An email-sending API built with Laravel, with a Next.js dashboard. You build the form in the dashboard and add it to a site with one line of script (or an iframe, or its own public page). It draws itself with your fields, design and texts, so a change in the dashboard reaches every site at once. The API validates, stores and delivers each message in the background. Use it for contact forms, quote requests, waitlists, lead capture or notifications from your own apps.

The problem

Every website needs a contact form, and it almost always ends up as a loose email-sending script. It freezes the page when the mail server is slow, loses messages when it fails and lets spam through. I wanted to solve this once, the right way.

See it running

Every screen of the dashboard.

The path of a submission

From the visitor's click to the inbox, in four steps.

  1. Receive

    The visitor's website sends the fields to the form's public address.

  2. Filter

    A trap for bots, a list of allowed websites and a limit on submissions per minute.

  3. Queue

    The message is stored and goes to the queue. The response to the visitor comes back right away.

  4. Deliver

    A separate process sends the email, retries if it fails and records the status of each recipient.

Architecture decisions

  • Email never freezes the page

    Sending happens in a Redis queue, with retries and the delivery status of each recipient. If the mail server goes down, nothing is lost.

  • No token in the browser

    A token on a public website is a secret that isn't secret. Instead, the form controls the allowed websites, and there is a limit on submissions per form and visitor.

  • Spam stays in view

    A bot trap separates the spam. It doesn't go to your email, but it stays stored in Messages as Spam, so you can check that nothing legitimate was blocked.

  • One form, everywhere

    The same form works as a script, an iframe or a public page. Its fields, CSS and texts live in the dashboard, and its styles are isolated, so they never touch the page around it.

  • The preview is the real email

    The editor preview and the delivered email come from the same renderer, so what you see is what arrives. Every submitted value is escaped.

  • Docs generated from the code

    The API documentation comes from the code itself, and the tests fail if an endpoint is left unexplained. SMTP credentials are stored encrypted in the database.

Technologies

  • Laravel 13
  • PHP 8.4
  • PostgreSQL
  • Redis
  • Next.js
  • TypeScript
  • Docker Compose
  • Pest
  • GitHub Actions
  • CodeMirror 6
  • Mailpit

See the code

The whole project is open, under the MIT license, and ready to run with Docker, in development or in production.

View on GitHub

Contact

Shall we talk?

A role, an opportunity or just a technical question. Tell me what you have in mind and I'll reply by email.

Or send a message from here