DEV Community

Discussion on: My first interactive email

Collapse
mpuckett profile image
Michael Puckett

Neat!

What is the method for form submission if you can’t use JavaScript (or...?)

My first guess would be that the CSS state swaps out various anchor links where the URL query string changes based on upvote or downvote or accept. You could add a submit “button” link below and it would only work if logged in. So it would save a click and the security issue would be resolved.

Collapse
tedgoas profile image
Ted Goas Author

Yep, no "submit" button. Honestly I haven't figured out that part yet either, hoping to work with one of the devs on my team to figure it out.

Collapse
jakehamilton profile image
Jake • Edited on

You could try using a background-image with a unique url and only display the element when the user clicks on another element. There would be lots of state to manage, but the css can be generated.

This way you can send arbitrary http requests with meaningful payloads without JS.

Thread Thread
ravavyr profile image
Ravavyr

background images don't work in most email clients.
Although your suggestion made me think they could use multiple submit buttons and based on selection a different button would be visible containing the values in the url it submits to. [makes for ugly inaccessible code though, but all email code is fugly]

Thread Thread
jakehamilton profile image
Jake

Ah, such is the wild west of HTML emails! I had no idea background-image wasn't supported, that's pretty crazy.

Thread Thread
tedgoas profile image
Ted Goas Author

background-image has pretty good support in email, but nothing's ever a given in the world of email development.