Forum

Thread tagged as: Forms

perch:success despite SMTP failure

I have a website which utilizes the Forms app to email form submissions via SMTP. We do not store responses due to sensitive personal data. Recently, due to a hosting change, SMTP connect() started failing, however, the perch:success message was continuing to show, and <perch:error for="all" type="general"> didn't catch the failure, so we didn't realize that the forms weren't going through until we were notified by users. Should perch:error show for a PHPMailer failure?

Shane Lenzen

Shane Lenzen 18 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, those are two different things, and a completely decoupled process.

The form submitted and validated correctly. The app registered to handle the form submission validated and accepted the data. That the emailing of that data failed doesn't mean there was an error with the form - there was an error with what you decided to do with the data subsequently, unrelated to the form.

If there's a chance you could lose that data through misconfiguration, a sensible route to take would be to enable the option to save it to the database. Email is a poor way to handle sensitive personal data on the whole.

This is a website for a bank and -- oddly enough -- to maintain PCI compliance, the data can't be stored on the hosting server. At the request of my client, it needs to be mailed over secure SMTP to an in-house mail server. Any other way to detect when PHPMailer fails? I understand that perch:success is only related to form validation, but it would be nice to know if PHPMailer failed in any case. Most (if not all) of my clients prefer to receive form submissions via email rather than viewing them in the CMS.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, we don't have a way for you to do that - and throwing an error to the customer if your server is misconfigured sounds like the wrong approach to me. It sounds like you need to have a process in place to make sure that the application gets updated when the mail server configuration changes. i.e. this is a procedure issue rather than a technical one.

Totally agree that configuration changes are a procedure issue, I'm just thinking about general errors, like the mail server is down, etc. Am I crazy for wanting to know when PHPMailer fails?? As I mentioned, the vast majority of my clients don't log in to the CMS to view submissions, they just want them in their email.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

That's over and above what a CMS should be doing. If you want alerts from things failing on your server then there are plenty of monitoring tools you can use to monitor the state of the system (I like Scout https://scoutapp.com/info/server_monitoring). That would be the appropriate way to solve the problem.

Food for thought. Thanks Rachel.