Adding custom fields to Carrier form
To add new fields to the Carrier form you need to hook into the notification/carrier/registered
action.
use BracketSpace\Notification\Repository\Carrier\Email;
use BracketSpace\Notification\Repository\Field\InputField;
add_action(
'notification/carrier/registered',
function($carrier)
{
if (! $carrier instanceof Email::class) {
return;
}
$carrier->addFormField(
new InputField(
[
'label' => __('Example Field', 'textdomain'),
'name' => 'example',
'resolvable' => true,
]
)
);
}
);
Last updated