benecaster_email_editor_template_html
Filters the body HTML a design rendered to, before it is sanitized and stored. It runs at save, and for each of a show’s saved designs when its branding is saved, never per recipient. Keep the {{_if_block_ID}} and {{_end_block_ID}} markers around a conditional block, or that block goes to everyone.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$html |
string |
— | The rendered body |
$design |
array |
— | The design: `{ version, blocks: [ { id, type, props, conditions } ] }` |
$type |
string |
— | The email type |
$show_id |
int |
— | The show, or 0 for the site-wide design |
Returns:
string
Example
add_filter( 'benecaster_email_editor_template_html', function ( string $html, array $design, string $type, int $show_id ): string {
return 'welcome' === $type ? $html . '<p>{{show_title}} is made with love.</p>' : $html;
}, 10, 4 );
Notes
Walkthrough: React when a podcaster saves an email design.
Need this built rather than just documented? See our services →