I am using hook_mail_alter in drupal 8 to alter the email messages sent through contact form .
How can I access $message['params']
fields in hook_mail_alter()
?
I am getting the following values with print_r(array_keys($message['params']));
.
Array (
[0] => contact_message
[1] => sender
[2] => contact_form
)
Can anyone suggest how I access the contact form fields?
When I access the values with print_r($message['params']['contact_form']);die;
I don't get anything displayed.