Email Studio: overview
A customer asks for a password reset, and the email that arrives looks like your site, in the language they read. Each automatic email your site sends to people with accounts has one branded template shared by all your sites. You edit it per language, check it with a preview and a Send draft test button, then activate it.
Password reset and verification emails use these templates from the day you install, and go out through your site’s normal mailer. The log, called Delivery messages, does not list them. It records test sends and the other account emails, such as welcome and sign-in notices. These stay off until you switch them on in settings, and go out as background jobs running on your server. Those sends need a default delivery profile for all sites, the mail settings Email Studio sends through. Only a Super Admin can create that profile or see those emails in the log. There are no mailing lists or broadcasts. A separate Sent emails list, for administrators who see every site, shows opens and clicks on tracked mail.
When your mail service reports a hard bounce or a complaint, later logged sends skip that address. Search Delivery messages for a customer’s address and you see whether their welcome or sign-in notice was sent or failed, and why.
What it does
Section titled “What it does”Email Studio manages Capell’s transactional email. Packages register the templates they can send; administrators can create site- and locale-specific overrides, brand them with reusable themes, send tests, and review MailTracker delivery activity.
Setup requirements
Section titled “Setup requirements”Run the package and settings migrations. Configure the host application’s Laravel mailers, keep a queue worker running for the queue named by CAPELL_EMAIL_STUDIO_QUEUE (the default queue unless changed), and keep Laravel’s scheduler running. Email Studio schedules body pruning and MailTracker-row purging daily with overlap and single-server protection.
Provision at least one default EmailProfile before sending. Create and edit profiles under Email Studio > Delivery profiles (permissions ViewAny, View, Create and Update on EmailProfile): site (or global), sender and reply-to identity, provider, tracking choices, the default flag and the provider’s webhook credentials. Site administrators see and manage only profiles of their own sites; global profiles can be created and managed only by global administrators. A default profile is used for emails in its site that do not choose a profile, falling back to the global default. Saving a profile as the default clears the default from other profiles in the same site. Profiles cannot be deleted from the admin because messages and template variants reference them. The built-in SMTP adapter sends through a configured Laravel mailer. The Postmark adapter also sends through Laravel’s mailer abstraction, defaulting to the postmark mailer; it is not a separate native Postmark API client. Never use the Fake profile in production.
For a site-scoped send, profile resolution prefers that scope and then global. It then chooses a default profile, preferring the configured default_provider (smtp by default). The database does not enforce one default per scope, so maintain exactly one intended default rather than relying on row order.
Author templates safely
Section titled “Author templates safely”Go to Email Studio in the admin:
- Email templates is the package-registered catalogue. Definitions cannot be created or edited there. Use Customise to create a Draft database override for that registration’s site scope.
- Template variants contains the editable subject, preview text, HTML/text body, optional CC/BCC recipients, delivery profile, locale, and theme.
- Template themes contains reusable branding. A default theme is selected per site-scope key.
- Sent emails is the read-only MailTracker log, not a queue retry screen or a complete view of Email Studio message records. Tracked copies carry no site, so only global administrators can open it, whatever permissions a site-scoped role holds.
Save a Draft, then use Preview draft and Send draft test on its edit page before activation. The library’s Preview live template and Send test continue to use the active version or static default. Activate retires the previous Active variant for the same template, site-scope key, and locale, records approval, and makes the template Approved. If no Active override resolves, a renderable registered definition remains the fallback.
Send test delivers immediately using the registered sample variables. It does not use the normal queued job, but still requires a resolvable profile and honours global and site-scoped suppressions. Tests go only to the explicit Test recipient; template CC/BCC defaults are excluded. Ordinary sends still include configured copies. Check every locale before activation. Feedback reports provider acceptance or failed, partial, suppressed, pending or uncertain outcomes; acceptance does not establish inbox delivery. Authorised users can follow the Delivery messages link.
Delivery, suppression, and recovery
Section titled “Delivery, suppression, and recovery”For a missing email, start at Email Studio > Delivery messages, filter by Recipient email, and inspect its status, timing and failure reason. A queued attempt needs worker/provider checks; failed attempts need cause correction; uncertain attempts require provider reconciliation before retrying to avoid duplicates. A Sent state records provider acceptance. Continue to Sent emails only for engagement and stored content where the host mail configuration provides Mail Tracker coverage. Zero opens does not prove failure, and an open/click signal does not establish inbox delivery.
Normal sending records the rendered subject, HTML/text body, context, recipients, attachments, profile, and selected variant before dispatching SendEmailJob. The worker re-checks suppressions before provider handoff. A provider can return per-recipient failures, producing Failed or Partially failed records.
The queued job has four attempts with 60, 300, and 900 second back-offs and a two-hour retry window. However, a thrown provider result is recorded as Uncertain, and stale interrupted Sending records also become Uncertain rather than being sent again blindly. Use provider evidence to reconcile uncertain recipients before arranging any deliberate resend. Email Studio has no admin retry action for these message rows; use application queue/log tooling and an integration around the reconciliation action.
Bounce and complaint provider events create active suppressions automatically. Global suppressions block every site; site-scoped suppressions block only that site scope. There is currently no suppression management or self-service unsubscribe screen, so manual suppression and release require an integration using the package actions. Do not describe the package as providing marketing-email unsubscribe compliance on its own.
Provider webhooks and tracking
Section titled “Provider webhooks and tracking”Provider events post to /mail/provider-events/{token} by default and are rate-limited. Creating a profile issues its provider-event URL, and Issue new provider-event URL replaces it. The URL is shown once, only its SHA-256 hash is stored, and the previous URL stops working immediately, so copy the new one into the provider straight away. The URL reaches the next screen through your session and is removed as soon as its dialog opens, so a reload or a second tab does not show it again; if the dialog is closed before you copy it, issue a new URL. Postmark profiles require configured Basic-auth credentials; Mailgun, SES (through SNS) and Resend profiles verify each provider’s own signature; SMTP and custom profiles require X-Capell-Email-Studio-Timestamp and an HMAC-SHA256 signature of timestamp.body in X-Capell-Email-Studio-Signature. Signed requests older than webhook_tolerance_seconds (sns_tolerance_seconds for SES) are rejected, and a bad signature gets 400. Postmark signs nothing and sends no timestamp, so its replay protection is the dedupe below. Core’s inbound webhook receiver stores each delivery once per profile and provider event id and applies it on the queue, so a retry or replay has no second effect; failed events are retried from Developer > Webhook Events or with the capell:webhooks:replay command. Only permanent bounces and complaints suppress an address; an unsubscribe is recorded as an event and never blocks transactional mail. Webhook credentials (Postmark username and password, Mailgun signing key, Resend and SMTP webhook secret) are entered in the profile form, encrypted at rest, never shown back and never included in serialised profiles. A blank field keeps the stored value, a new value replaces it, and the Remove action (with confirmation) deletes it; a Resend secret must start with whsec_; changing the provider discards credentials the new provider does not use. The profile list shows whether each profile can currently verify provider events. Credentials set earlier by an installer or seeder keep working and are kept when the form is saved.
Events are stored idempotently per profile and can update recipient state or create a suppression. Correlation uses the provider message ID first. If it is absent or unknown, the action falls back to the latest recipient under that profile with the same email hash. Configure providers to return the message ID and include it in events; without it, repeated sends to one address can be matched to the wrong record. Inbound-reply normalisation and storage types exist, but this package does not expose an inbound-reply ingestion route.
Open and click counts are signals, not proof that a recipient read a message. They depend on tracking being enabled and on the mail client loading the pixel or following a rewritten link. Review the privacy basis for tracking before enabling it.
Permissions and data visibility
Section titled “Permissions and data visibility”The resources use their generated ViewAny, View, Create, and Update permissions listed in the package manifest; global administrators bypass them. Record policies reject site-owned template records outside a non-global administrator’s assigned sites, but the resource base queries are not site-scoped. Global records are available to every permitted role. The MailTracker sent_emails rows do not carry a Capell site ID, so Sent emails is installation-wide and can expose recipient, sender, subject, content, and tracked links across sites. Grant these permissions only to roles allowed to inspect all listed data; do not treat the resources as a hard tenant boundary.
Delivery profiles, Email Studio message/recipient/event/reply/suppression data, rendered bodies, context, failures, and provider payloads use encrypted casts for their sensitive fields. Template variant subject/body and CC/BCC values, theme metadata, attachment references, provider message IDs, lookup hashes, tracking tokens’ destination URLs, and MailTracker’s sent-email rows are not encrypted by this package. Protect database, storage, queue payloads, logs, backups, and admin access accordingly, and keep the application encryption key available for old records during key rotation.
Retention and authentication email settings
Section titled “Retention and authentication email settings”Two daily jobs have different effects:
- MailTracker rows and their click rows are deleted after the setting’s retention period (60 days by default). Setting that period below one disables this purge.
- Email Studio’s rendered HTML/text bodies are cleared after
capell-email-studio.body_retention_days(90 days by default). This deployment config is separate from the settings screen and is clamped to at least one day. The message row, subject, context snapshot, headers, attachment references, recipients, provider events, and delivery metadata remain.
No scheduled job deletes Email Studio message, recipient, event, reply, profile, suppression, template, variant, theme, or tracking-token rows, and the package does not contribute a Privacy Centre exporter or eraser. Include these records, MailTracker data, provider data, queue payloads, stored attachments, logs, and backups in the installation’s subject-access and erasure process.
The settings surface enables Email Studio replacements for verification and password-reset mail by default. Welcome, verified, login, lockout, and password-reset-success lifecycle messages are opt-in. Enable them only after testing the active templates and delivery profile, because they add mail to authentication events rather than merely changing presentation.
For how to use Email Studio, see the admin guide. For developers: see the README, email-studio-api.md, email-studio-database.md.