Redis causing issues with complicated form? #9425
Replies: 5 comments 6 replies
-
So you're handling the email sending on your own? |
Beta Was this translation helpful? Give feedback.
-
Nope - it's just the form implementation that doing something nonstandard with the redirect to Stripe. The email is sent via out of the box Statamic mailer / Laravel Mail Driver / Postmark. The only other thing that's not out of the box is that I had to manually update my Peak with the changes to the form handler and emails templates required for the shift to Laravel Precognition support. As mentioned, form submission and email send all works exactly as expected with Redis turned off, but maybe there's another change that I missed that might explain it? |
Beta Was this translation helpful? Give feedback.
-
Also I don't know if there's some Redis config I need to do? I have other Statamic / Peak sites with redis handling Git that are sending form emails as expected, where I've done nothing beyond enabling the redis queue in Forge and making sure the deploy scripts are all set up exactly as per the Statamic docs. These would all be pre v16 Peak and without the new form stuff mentioned above. |
Beta Was this translation helpful? Give feedback.
-
That's very weird, let's see the form yaml and blueprint |
Beta Was this translation helpful? Give feedback.
-
Form yaml
Blueprint
|
Beta Was this translation helpful? Give feedback.
-
Is it possible to turn off Redis for (eg) emails, but keep it on for everything else? And does email have its own log that I can access - if not, where would errors that occur when an email layout is generated appear?
I've been trying to debug a form that has a custom fieldtype which interacts with Stripe. On my local machine, with no Redis enabled, submitting the form generates a submission, an email (via the postmark mailer), and then redirects to Stripe checkout.
On my dev server, with Redis enabled, the submission and redirect work perfectly, but the email sends without any {{ fields }} content - both plaintext and HTML emails come through, but without any data. Other forms on the same server, but without the custom fieldtype, work perfectly.
If I turn off Redis, everything works. But I'd like to keep Redis on for Git automation and other background tasks. I've looked in logs and used debugbar, but I don't get any errors that I can see that could explain the issue.
My best guess is that Redis allows the email to send or the redirect to Stripe to happen before the form has finished processing data.
But I can't find much documentation either on Redis and Statamic, or on the exact process for form submission / emailing, particularly when Ajax is being used to validate / submit (I'm using a recent version of the Peak starter kit: the forms use Laravel precognition and submit with an ajax form handler, with a minor alteration so the redirect url returned by the Ajax call takes the user to Stripe Checkout.) Would really appreciate a pointer if someone's had a similar issue...
Beta Was this translation helpful? Give feedback.
All reactions