Subscribe Forms & Shortcodes
OM_Shortcode renders subscribe forms on the frontend.
Shortcode
[om_subscribe]
[om_subscribe list_id="3"]
[om_subscribe list_id="3" label="Subscribe for updates" button="Join Now"]
[om_subscribe list_id="3" show_name="true" double_optin="true"]
Attributes
| Attribute | Default | Description |
|---|---|---|
list_id | default list | Mailing list to subscribe to |
label | "Subscribe" | Form heading |
button | "Subscribe" | Button label |
show_name | false | Show first/last name fields |
double_optin | setting | Override double opt-in per form |
redirect | "" | URL to redirect after success |
success_message | "" | Custom success text |
Gutenberg Block
OMailer registers an OMailer Subscribe Gutenberg block with the same attributes, configurable from the block inspector panel.
PHP: Render Programmatically
php// Render a subscribe form
echo OM_Shortcode::render([
'list_id' => 3,
'show_name' => true,
'label' => 'Get weekly updates',
'button' => 'Subscribe Free',
]);
Double Opt-In Flow
- Subscriber submits form → status set to
pending; confirmation email sent - Subscriber clicks confirmation link → status updated to
subscribed;subscribeautomation trigger fires - If not confirmed within 7 days → pending record deleted by weekly cron
