0

I am writing a simple mailing application, however I am not yet aware of the full capabilities of HTML editing within the mailing world.

I would like to give the website administrator the choice to accept or to refuse a reservation by sending him an overview of the reservation. Below in the mail I had 2 buttons in mind, accept & refuse.

I tried using a form within the HTML e-mail but almost every mailing client blocks this out.

Is there another method to do a http post command to let's say myserver.com/accept or myserver.com/refuse from within an e-mail without having to open an additional webpage?

If not, what is the best way to achieve such things?

Djov
  • 654
  • 1
  • 10
  • 19

1 Answers1

1

This is a pretty relevant article: https://www.sitepoint.com/forms-in-email/

Basically he concludes that support is not reliable so you should not use forms in emails which I agree with.

Since you say you want to give this choice to a website administrator I think you probably want some sort of authentication. So I could see it working something like this...

  1. Send the admin an email containing two links mysite.com/reservations/:reservation_id/accept and mysite.com/reservations/:reservation_id/refuse.

  2. Admin clicks on one of the links

  3. Link opens in the browser and your site(controller -> ReservationService) accepts or refuses based on the id and action in the url

You will have a few things to consider, such as authentication(I assume you already have this since you have the notion of website admin?), authorization(can this admin accept or deny the reservation?), does the reservation exist, has the admin already accepted or denied the reservation, etc.

Ryan
  • 5,845
  • 32
  • 27
  • Hi there, Thank you for confirming. I thought I was doing something wrong. I indeed have the necessary authentication running. However I lack the knowledge on how to read part of the URL after my server's URL. Let's say I have a server listening at mysite.com/reservations: how can I get my Node server to read the :reservation_id? This concept seems new to me. – Djov Sep 08 '16 at 13:39
  • http://stackoverflow.com/questions/20089582/how-to-get-url-parameter-in-express-node-js The following stackoverflow question and answer helped me a lot. I appreciate your effort! Thanks a lot. :) – Djov Sep 08 '16 at 14:49