benecaster_email_editor_default_design
Filters what an email opens on in the Email Editor when nothing is stored for it. Return [ 'blocks' => [ … ] ] to give your own email type a starting design. It only fills the canvas.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$design |
array|null |
— | The starting design, or null |
$type |
string |
— | The email type |
Returns:
array|null
Example
add_filter( 'benecaster_email_editor_default_design', function ( ?array $design, string $type ): ?array {
return 'my_addon_receipt' === $type ? [ 'blocks' => [ [ 'id' => 'a', 'type' => 'heading', 'props' => [ 'text' => 'Thanks!' ] ] ] ] : $design;
}, 10, 2 );
Notes
Walkthrough: Give your add-on's email a starting design.
Need this built rather than just documented? See our services →