Home/Use cases/Form submission notifications
Use case · Forms & leads

Get a push notification on every form submission

A contact form that emails you is a form you'll answer three hours late. On a small site, a new lead or enquiry is worth knowing about the instant it lands. Add one HTTP POST to your form handler and Lert buzzes your phone the moment someone hits submit — name and message right there on the lock screen.

The one-line version

Lert gives you a unique URL. Your form handler already runs some code when a submission arrives — save to a database, send yourself an email. Add one more line to that code and your phone gets a notification too.

Node / Express

Handle the submission as you already do, then POST to Lert. The catch matters: a hiccup reaching Lert must never turn into a failed form for the visitor.

Node / Express
const LERT_URL = "https://lert.dev/p/your-id";

app.post("/contact", async (req, res) => {
  const { name, email, message } = req.body;

  await saveLead({ name, email, message });   // your existing logic

  // Fire-and-forget: never block the visitor on the ping
  fetch(LERT_URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      title: `New enquiry — ${name}`,
      body: message.slice(0, 180),
      tag: "contact-form"
    })
  }).catch(() => {});

  res.redirect("/thanks");
});

PHP

Same shape in plain PHP — no framework needed. This is the classic contact.php that shared hosting is full of, with three extra lines at the end:

PHP
<?php
$name    = trim($_POST['name'] ?? '');
$message = trim($_POST['message'] ?? '');

// ... save the lead / send yourself the email as usual ...

$payload = json_encode([
  'title' => "New enquiry — $name",
  'body'  => mb_substr($message, 0, 180),
  'tag'   => 'contact-form',
]);

$ch = curl_init('https://lert.dev/p/your-id');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 10,
]);
curl_exec($ch);
curl_close($ch);

header('Location: /thanks.html');

Set it up in three steps

1. Copy your Lert URL

Open the Lert app and copy your unique endpoint — something like https://lert.dev/p/your-id. Treat it like a password: anyone who has it can send you a notification, and it lives server-side in your handler, never in the page's front-end code.

2. Add the POST after you handle the submission

Save or email the lead first, then send the Lert POST. Put the sender's name in the title and a short snippet of their message in the body so you can judge urgency without opening anything.

3. Submit a test

Fill out your own form once. Your phone should buzz within a second or two — a real iOS push that wakes a locked screen and hits a paired Apple Watch.

Keep the URL off the front end. Always POST from your server-side handler, never from browser JavaScript — a URL in page source is a URL anyone can spam. If you're on a static host with no backend, route the form through a webhook or a tiny serverless function. See also the Node and PHP guides.

Keep it signal, not noise

  • Spam-check first: run your honeypot, rate limit, or captcha before the POST, so bots never reach your phone.
  • Tag by form: set tag to contact-form, demo-request, newsletter so your in-app history is sortable.
  • Mind the lock screen: a name and a snippet are ideal; don't push full email addresses or anything you wouldn't want visible on a glance.
  • Redirect first, then notify: the visitor's "thanks" page should never wait on the notification — send it fire-and-forget.

Why Lert for form alerts

Email is where form notifications go to be ignored, and the hosted "form to Slack" services want an account, a webhook, and a monthly fee. Lert is one URL and one POST from code you already wrote. The endpoint is the authentication — no key, no SDK — and it's a real push, so the next lead reaches you in seconds instead of whenever you next check your inbox.

FAQ

Should I send the notification before or after saving the submission?

After. Save or email the submission first so a slow ping never blocks the visitor's response, then fire the Lert POST fire-and-forget. Wrap it in a catch or ignore its result so a notification failure can't break the form.

Can I put the person's message in the notification?

Yes. Name in the title, a short snippet of the message in the body. Keep the title under 120 characters and the body under 2000, and avoid pushing anything sensitive you wouldn't want visible on a lock screen.

What about spam submissions?

Run your spam check first — honeypot field, rate limit, or captcha — and only send the Lert POST for submissions that pass. That keeps your phone quiet and every buzz meaningful.

Do I need an API key or account?

No. Your Lert endpoint URL is the authentication — there's no separate key, token, or login. Keep it server-side in your handler.

How fast does the notification arrive?

Typically within a second or two of the POST. It's a real push, so it wakes a locked phone and buzzes a paired Apple Watch.

Never miss a lead again.

Download Lert, copy your URL, add one POST to your form handler. Your phone buzzes on every submission.

Get the app iOS