Hi,
I followed the example in the cookbook for a basic contact form and it works.
Questions is: how do I go about translating the error message and success message?
I assume it should be in this part of the code?
} catch (Exception $error) {
$alert['error'] = "The form could not be sent";
}
// no exception occured, let's send a success message
if (empty($alert) === true) {
$success = 'Your message has been sent, thank you. We will get back to you soon!';
$data = [];
}
but I take it I can’t just use the “t(‘error’)” function that’s used elsewhere to have translations show up…?
A pointer would be great! Thanks!