3 ms·
I want to send you an email from a web page, for example a "Click this link to complete your registration" type thing. Your mailserver is paranoid (and rightly
by Gordonjcp 4y ago
I want to send you an email from a web page, for example a "Click this link to complete your registration" type thing. Your mailserver is paranoid (and rightly so) and responds very slowly to greylisted mailservers like mine that it has never heard from before, so it takes about a minute to complete the message.
The webpage I wrote twenty years ago would accept your POST request, wrap up everything into the email, send it, return a redirect to a GET to the same page, and finally send you a page saying "Thanks! I've sent you an email with a link to click on to confirm it's really you." You would not get this web page because your browser would have timed out, or maybe you would but you'd think "Jeez this site is so slow" not realising that it's just waiting for you.
The webpage I wrote ten years ago would accept your POST request, wrap up everything into an email, send it to a message queue, and so on except maybe now I'd say "I am sending you" rather than "I have sent you", which you'd see immediately. Around the same time, a queue worker notices a new email in the queue, sends it, hangs around for a minute or so waiting for your server. You get the email, click the link, wow what a nice fast responsive site!
The webpage I wrote last year would do much the same thing, but the queue worker might flip a flag in your account to say the email has been sent but the link has not been clicked. Meanwhile a wee bit of javascript is polling an endpoint watching for the flag, and flips the text round to say "Check your email, it's been sent".