Hi i have code:
add_filter(
'hivepress/v1/forms/message_send',
function ( $form ) {
$form['fields']['name'] = [
'label' => 'Imię i Nazwisko',
'type' => 'text',
//'required' => true,
'min_length' => 5,
'max_length' => 50,
'_order' => 1,
];
$form['fields']['email'] = [
'label' => 'e-mail',
'type' => 'email',
'min_length' => 5,
'max_length' => 30,
//'required' => true,
'placeholder' => 'noreply@superwypoczynek.pl',
'_order' => 2,
];
$form['fields']['phone'] = [
'label' => 'Telefon',
'type' => 'phone',
'country' => 'PL',
//'required' => true,
'placeholder' => '500 000 000',
'_order' => 3,
];
$form['fields']['okres'] = [
'label' => 'Okres',
'type' => 'text',
'min_length' => 20,
'max_length' => 100,
//'required' => true,
'_order' => 4,
];
return $form;
}
);
I have a few questions about it
- How to add these fields to messages in messages, currently only the default text field appears.
- How to include these fields only in a modal. They will now also appear when replying to a message.
- How to add these fields as tokens so that they can be included in the notification email. I have tried to work with this code but not successfully.
add_filter (
'hivepress/v1/emails/message_send',
function ( $email ) {
$email['tokens']['okres'] = ['okres'];
return $email;
}
);```