openform icon indicating copy to clipboard operation
openform copied to clipboard

On handlebars error: there is no error message when sending an email fails

Open Timo-Breumelhof opened this issue 4 years ago • 7 comments

If you make a mistake in the forms email body (for sending emails) it appears as if the email is sent but it's not. IMO it would be better to show an error message in that case.

I had {{email} in one of the lines and it took me a while to understand why the email was not sent out

Timo-Breumelhof avatar Apr 22 '20 06:04 Timo-Breumelhof

I have looked at this in the past. Indeed errors are being caught, but je never bubble up to the interface (in code FormUtils.cs:323). Quick fix that I implemented at that time was to Log the error in the Dnn Log.

robsiera avatar Apr 22 '20 07:04 robsiera

I have looked at this in the past. Indeed errors are being caught, but je never bubble up to the interface (in code FormUtils.cs:323). Quick fix that I implemented at that time was to Log the error in the Dnn Log.

ok thanks. And as it's JS you cannot "show" a dnn error, right?

Timo-Breumelhof avatar Apr 22 '20 07:04 Timo-Breumelhof

@robsiera I don't see a line 323 in FormUtils.cs ..?

Timo-Breumelhof avatar Apr 22 '20 08:04 Timo-Breumelhof

https://github.com/sachatrauwaen/openform/blob/4d865bbe543fccce15deeb73947cbadcfd287557/Components/OpenFormAPIController.cs#L284

Timo-Breumelhof avatar Apr 22 '20 08:04 Timo-Breumelhof

Sorry, that was for OpenContent. For OpenForms indeed it is line 305 of OpenFormAPIController. Errors are caught, and gathered in res.Errors collection. But that list of errors is never used anymore.

robsiera avatar Apr 22 '20 08:04 robsiera

ok np :-)

Timo-Breumelhof avatar Apr 22 '20 08:04 Timo-Breumelhof

Possible issues to test: Most important thing is to know if the email was delivered by DNN for sending. BTW, this is a open form issue, but I have the issue in open content ATM.

  • On error in handlebars in : A. Email body text B. Custom From / to / reply to fields C. Email subject

  • When using {{}} in a from / to / reply to field is set to "form field"

Maybe there are other circumstances in which this could go wrong, not sure.. :-)

Timo-Breumelhof avatar Apr 23 '20 08:04 Timo-Breumelhof