docs

Embedding forms

Add a Sendra signup form to your website with a JavaScript snippet.

You can embed a Sendra signup form on any website using the provided JavaScript snippet.

Getting the embed code

  1. Go to Forms and select a form
  2. Click Embed
  3. Copy the JavaScript snippet

The snippet looks like this:

<script src="https://your-sendra-instance.com/api/forms/FORM_ID/embed.js"></script>

Add this to your HTML wherever you want the form to appear.

How it works

The embed script:

  1. Loads asynchronously (won't block your page)
  2. Renders a styled form at the script's location
  3. Handles submission via the Sendra API
  4. Shows success/error messages inline

Custom forms

If you want full control over the form's appearance, you can build your own form and submit to the Sendra API directly:

<form id="sendra-form">
  <input type="email" name="email" placeholder="you@example.com" required />
  <button type="submit">Subscribe</button>
</form>
 
<script>
  document.getElementById('sendra-form').addEventListener('submit', async (e) => {
    e.preventDefault();
    const email = e.target.email.value;
    await fetch('https://your-workspace.sendra.so/api/forms/FORM_ID/submit', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ email }),
    });
  });
</script>

Replace FORM_ID with your form's ID and your-workspace.sendra.so with your workspace URL.

On this page