user2206724
user2206724

Reputation: 1375

Rails: How to pass sender email and receiver email with unsubscribe link in email

I am working on unsubscribe feature. I am building an app where users can create their email list and can send emails.

I want to add unsubscribe link in emails users are sending.

But I am not getting how the link should be for unsubscribe.

I have unsubscribe page where unsubscriber will be redirected if he clicks on unsubscribe link in sent email.

On this page, I want to display, unsubscriber's email address and sender's emails address so I can save these addresses and delete unsubscriber's address from user's list.

This is view of my unsubscribe link:

       To unsubscribe click here: <a href=\"https://localhost:3000/messages/unsubscribe\">unsubscribe</a>

Can anybody help me? Hope I am able to clarify what I wanted to convey.

Thanks.

Upvotes: 0

Views: 192

Answers (1)

bluehallu
bluehallu

Reputation: 10295

Just add whatever it is that identifies your subscription to the url as a GET parameter, then generate the page accordingly. You might want to use some sort of token system if you want to prevent anyone from being able to unsubscribe anyone else just by inputting the target email in the url though.

Upvotes: 0

Related Questions