# WordPress plugin

Put your SendBeam forms on a WordPress site, add a pop-up, collect opt-ins at registration or checkout, and send the site's own email from your verified domain.

The SendBeam plugin connects one WordPress site to one SendBeam workspace. Install it, press
**Connect SendBeam**, approve what the site may do, and you are connected in two minutes —
no API key to create or paste ([Connecting the plugin](https://sendbeam.io/docs/wordpress/connecting)). It then
puts your forms on the site, runs pop-ups with their own targeting, collects opt-ins from the things
people already do on a WordPress site, and can carry the site's own email.

## What the plugin does

- **Forms** — a *SendBeam Form* block and the `[sendbeam_form]` and
  `[sendbeam_contact]` shortcodes. Any form, on any number of pages.
- **Pop-ups** — as many as you like, each with its own form, targeting and trigger.
- **Audience** — an opt-in tick box on account registration, comment forms and
  WooCommerce checkout.
- **Form plugins** — people who fill in Contact Form 7, Elementor Pro, WPForms, Gravity Forms
  and Fluent Forms forms, with their consent, added to SendBeam. See
  [Form plugins](https://sendbeam.io/docs/wordpress/form-plugins).
- **Site email** — everything WordPress sends with `wp_mail()` goes out through
  your verified sending domain instead of the server's own mailer.

Forms render from their hosted page on sendbeam.io, so a change you make in SendBeam appears on the site
straight away and your theme's CSS never fights the form's. They still take your site's colours — see
[Forms on a page](https://sendbeam.io/docs/wordpress/forms).

## Install it

Install **SendBeam** from Plugins → Add New, or upload the release zip from
[the repository](https://github.com/sendbeam-io/sendbeam-wordpress). It needs
WordPress 6.1 or later and PHP 7.4 or later. Activating it adds **Settings → SendBeam** and
nothing else; no tables are created and no files are written.

## Connect it

Go to **Settings → SendBeam**, tick what the site should be able to do and press
**Connect SendBeam**. A SendBeam window opens, you sign in or create an account, you approve
the list, and the plugin gets its own key — see [Connecting the plugin](https://sendbeam.io/docs/wordpress/connecting) for what each permission allows and how to disconnect.

To connect by hand instead:

1. In SendBeam, go to [Settings → API keys](https://sendbeam.io/settings/api-keys) and make a key for this site.
  Give each site its own key so you can revoke one without disturbing the others.
2. In WordPress, go to **Settings → SendBeam** and paste it into **Connect**.
3. The header shows **Connected** when the key works. If it says the key is rejected, it is
  the wrong key or the wrong workspace; if it says the key cannot read your forms, the key is right and
  is missing a permission — see below.

You can define `SENDBEAM_API_KEY` in `wp-config.php` instead, and the plugin will use
that and never write a key to the database. Useful where the database is shared with staging.

## Which permissions each feature needs

Only what you use. Placing a form or a pop-up needs no key at all.

- **Forms (read)** — lets the settings page and the block list your forms so you pick one by
  name instead of pasting an ID. Without it you can still type IDs by hand.
- **Lists (read)** — the Audience tab and its subscriber counts.
- **Contacts (read and write)** and **Lists (write)** — only for the opt-in box
  on registration, comments or checkout, and for connected form plugins.
- **Tags (read and write)** — only when a connected form adds a tag.
- **Send site email** (`transactional:send`) — only for Site email.

## What it sends us

Worth knowing before you switch things on, and the same list is in the plugin's readme.

- **Showing a form** — the visitor's browser loads it from sendbeam.io. The URL carries the
  appearance you chose, which is your settings, not anything about the visitor. Your server makes no
  request.
- **A submission** — what the visitor typed on that form.
- **The settings screens** — while an administrator has them open, your server asks us for
  your forms, lists and counts, using your key. Cached for five minutes. Nothing happens on front-end page
  loads.
- **An opt-in** — only when someone ticks the box: their address, name and which of the
  three places they were in.
- **A connected form plugin** — only for a form you switched on, and only when the person
  consented: their address, name, which form plugin it was, and the list and tag you chose.
- **Site email** — each message your site sends, so we can deliver it.

---
Source: https://sendbeam.io/docs/wordpress
