Unsubscribe: Best practices

I have a mailing list in a Postgres database and I want to give my users the ability to unsubscribe from mailings.

I wish to send out emails with a link to an RoR website to handle the unsubscribe.

Is there a document anywhere that describes how to do this properly? That is, what the link in the email should look like and what the controller(s), routes.rb, and view(s) should look like?

Do I need to do a (implied) DELETE verb anywhere?


You don't (really) want a GET action to result in a DELETE, though, so I would recommend that rather than try to make the link in the e-mail delete the record immediately, take the user to a regular page, where you can construct a POST to DELETE, in the usual Rails manner (method: :delete). That gives a person a chance to reconsider, too, in case they fat-fingered the link in a mobile e-mail client.


You basically need a boolean field in your mailing list table called subscribe.

you can toggle that with true or false for the user by asking a question and flipping this bit.

As far as sending a link - I already wrote this procedure. It’s quite easy.

basically have a controller that asks for the name and email address (capture that) , then send out a mailer with a link to the file you want.

I have my link to a file in the public folder (but the user isn’t aware of that until he get’s the email.)

I think I have to push an update to this code.

I’m missing the deliver after creating the record. I’ll do that tonight.