Skip to content
View as Markdown
Enter your site to enable Send. Requests are sent from your browser, so the site must allow cross-origin calls (CORS).

POST Preview Double Opt-in​

POST
/setting/double-optin/preview

Render a preview of unsaved double opt-in settings. Nothing is saved and no email is sent.

target picks what to render. By default the endpoint renders the confirmation email and returns its HTML, subject and sender. With target set to confirmation it renders the page a contact sees after they confirm, built from settings.after_confirm_message with the same markup and stylesheet as the public page. That message is filtered with wp_kses_post() unless the user has the unfiltered_html capability.

Smart codes are filled from the contact in contact_id. Without it, FluentCRM uses the contact linked to the current user, then the first subscribed contact. If none exists, the request fails.

Required capability: fcrm_manage_settings

Enforced by SettingsPolicy::previewDoubleOptin().

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Request Body​

application/json
JSON
{
"settings": {
"email_subject": "string",
"email_pre_header": "string",
"email_body": "string",
"design_template": "simple",
"after_confirm_message": "string"
},
"target": "email",
"contact_id": 0
}

Responses​

The rendered preview. The keys depend on target.

application/json
JSON
{
"preview_html": "<!DOCTYPE html><html>...</html>",
"preview_subject": "Please confirm your subscription",
"subjects": [
{
"id": 0,
"key": 100,
"value": "Please confirm your subscription"
}
],
"sender": {
"name": "Acme",
}
}

Playground​

Authorization
Body

Samples​

Powered by VitePress OpenAPI