Jump to content

sodesign

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by sodesign

  1. 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?
  2. Hi, I'm having an issue with the 'Test Settings' feature. Some background: I have a contact form which sends an email (triggered by ajax), which seems to work a couple of times, but then starts throwing 500 errors on send. At the same time, once the contact forms starts throwing 500 errors, clicking 'Test settings' in the module settings panel throws the same error: I'm not sure where to start finding the source of this issue - it seems that sometimes clearing compiled files solves the issue temporarily, but beyond this I'm not sure what to do. We're running the latest Dev branch, but swapping to Master didn't prevent the issue. Any advice on how to resolve this would be much appreciated! Thanks, Tom
×
×
  • Create New...