# Embedding a signup form

> Put a Reggio Digital newsletter signup form on any website with one line of HTML, or share it as a link.

Source: https://reggiodigital.com/developers/signup-forms

If all you need is a way for visitors to join a list, you do not need the API or a key. Every signup form built in the dashboard can be dropped onto any website with one line of HTML, or shared as a link.

## Getting the code

The business creates and styles the form under [Newsletter forms](https://reggiodigital.com/newsletter/forms): which list it adds people to, the heading, the button label, whether it asks for a first name, and the message people see afterwards. The form's page shows two things to copy.

**The embed code**, an iframe to paste wherever the form should appear:

```html
<iframe src="https://reggiodigital.com/n/f/YOUR_FORM_TOKEN/embed" style="width:100%;border:0;height:320px" title="Newsletter signup"></iframe>
```

**The link**, a full page with the same form, for a link in a bio, a QR code or an email signature:

```
https://reggiodigital.com/n/f/YOUR_FORM_TOKEN
```

The token in both is unique to the form. Copy them from the dashboard rather than building them by hand.

## Fitting it to your page

- The form fills the width it is given, so set the width on a container around the iframe.
- `height:320px` fits a form that asks for an email address only. Raise it if the form asks for a first name or has a longer description, so there is no inner scrollbar.
- The form carries the business's own branding from the dashboard. Change it there, and every page it is embedded on updates.

## What happens when someone signs up

A signup through the form follows exactly the same rules as the [subscriber API](https://reggiodigital.com/developers/newsletter):

- On a list that asks people to confirm, they get a confirmation email and are `pending` until they click it. Otherwise they are subscribed straight away.
- Where the address came from, and when, is recorded as their consent.
- Someone already on the list is not added twice, and someone who unsubscribed is not put back.
- If you have [webhooks](https://reggiodigital.com/developers/webhooks) set up, `newsletter.subscriber.subscribed` fires, then `newsletter.subscriber.confirmed` when they confirm.

The form protects itself against bots with Cloudflare Turnstile and a hidden field, and limits how often one visitor can submit. You do not need to add anything for that.

## When to use the API instead

Use the [subscriber API](https://reggiodigital.com/developers/newsletter) when the signup happens inside your own software, such as a checkbox at checkout, when you need to set custom fields or tags, or when you want the form to match your own site's code exactly. Post your own form to your server, and have your server call the API. Never call the API from the visitor's browser.
