0

I want to create one time links in Django but I have no idea where to start. The idea is to send a onetime registration link. The payload should contain information such as an email address and company name, so that when the customer clicks the link and registers the company name and email will automatically be send with the post.

Mart
  • 1
  • 1

1 Answers1

0

One way to achieve that is to create a link with query parameters in the URL.

URLtoRegisterTheCompany?email=company@email.com&company=companyName

Then when the user clicks the link you would open a new page, using Javascript you can then listen to the onload event of the page read both email and company query parameters and send a POST request to your backend. If the POST request succeeds you can tell the user something like your company was successfully registered and it fails and your return for instance a HTTP code 422 "Entity already exists", show your company was already registered.

loicgasser
  • 1,403
  • 12
  • 17