Thanks for the swift reply!
Prior to trying to send a form, I see:
Function SendMail($to, $subject, $body, $headers, $return_path)
Then once I have tried to send a form, I see this:
Function \ProcessWire\sendmail($to, $subject, $body, $headers, $return_path)
The partial which handles the ajax request is like this:
<?php
namespace ProcessWire;
use Valitron\Validator;
function getInput($modules, $sanitizer, $input, $user) {
...
$v = new Validator([ ... ])
...
$formFields = [...]
return $formFields; // This contains the sanitized form fields content and the validation results
}
function sendMail($formFields, $modules, $pages, $sanitizer) {
...
if ($v->validate()) {
...
$mail = wireMail()
->to($contactFormRecipient)
->header('Reply-To', $email)
->subject(ucwords($mailer_subject))
->bodyHTML($messageHTML);
...
}
}
}
$formFields = getInput($modules, $sanitizer, $input, $user);
$output = sendMail($formFields, $modules, $pages, $sanitizer);
if ($output['sent']) {
echo json_encode(array(...));
} else {
echo json_encode(array(...));
}
Does the namespaced compiled function look right to you?