-1

am trying to put a button in the email created with php so that when the user gets that email, they can click the button to delete a record in the database directly without leaving the email client or email window they are in. is it possible and how do i achieve that? Thanks.

Good John
  • 33
  • 1
  • 9

2 Answers2

2

The closest you can get I think is putting in a hyperlink to a web page which will automatically trigger the deletion when given the correct parameters. But it will still launch a web browser (and then a server-side script must run to do the deletion or whatever). And therefore you'll probably want to provide some feedback to the user on that page as well.

ADyson
  • 57,178
  • 14
  • 51
  • 63
  • so there must be a redirect. using a link – Good John Jun 17 '16 at 08:18
  • @GoodJohn exactly. You can't directly include a HTML form in an email. – ADyson Jun 17 '16 at 08:18
  • We need to actually solve the underlying problem rather than proposing something else that would work. – Keral Patel Jun 29 '20 at 19:50
  • @KeralPatel nice try, but this particular problem is not actually solvable in the way the OP would have liked. Hence "the closest you can get..." in the answer. A workaround is appropriate when the desired solution is genuinely not achievable. P.S. Did you seriously go and trawl my answers from 4 years ago just to try and make a point in riposte to my comments on your [own answer](https://stackoverflow.com/questions/62644025/include-file-outside-from-public-html/62645390#62645390)? Maybe if you spend more time you'll manage to find one where you can actually catch me out :-) – ADyson Jun 29 '20 at 19:56
  • hehehe feels good to know the real reason. Thank you for elaborating on it. – Keral Patel Jun 29 '20 at 19:59
1

No, this is not possible. At best your email will contain a link that will spawn a new window or tab that will access a page to delete the record.

j08691
  • 204,283
  • 31
  • 260
  • 272