Skip to content

Conversation

konsalex
Copy link
Contributor

Closes #77

Adds a JSON field to the DB with info like which list user unsubscribed from and the time they did.
Currently it has only marketing emails, we might expand later on.

To work on the cloud we need to create a manual migration to add the unsubscribe_id:

ALTER TABLE users
ADD COLUMN unsubscribe_id TEXT;

UPDATE users
SET updated_at = NOW(), unsubscribe_id = gen_random_uuid()::text
WHERE unsubscribe_id IS NULL;

Avoided having the user ID for unsubscribing, as this is a pretty public info, and this means bad actors could un-sub other folks.

Currently non of the emails in the repo contain the List-Unsubscribe as all of them are operational and not marketing.
Our marketing email should include this header. As soon as this is merged, I will run manually migrations for the cloud DB.

CleanShot.2025-09-12.at.11.20.20.mp4

Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for hoppdocs ready!

Name Link
🔨 Latest commit 01310cf
🔍 Latest deploy log https://app.netlify.com/projects/hoppdocs/deploys/68c49a0058891400081602bc
😎 Deploy Preview https://deploy-preview-90--hoppdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@konsalex konsalex requested a review from iparaskev September 12, 2025 09:28
iparaskev
iparaskev previously approved these changes Sep 12, 2025
Copy link
Contributor

@iparaskev iparaskev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

<div class="container">
<h1>Already Unsubscribed</h1>
<p>You have already been unsubscribed from all Hopp emails.</p>
<p>If you continue to receive emails, please contact our support team.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our "support team" 😆

return echo.NewHTTPError(http.StatusInternalServerError, "Failed to unsubscribe")
}

return c.String(http.StatusOK, "You are now unsubscribed from all emails marketing 🥲")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: marketing emails

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This at least proves its not AI written 😂

@konsalex konsalex merged commit 31a8135 into main Sep 12, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improvement: allow unsubscribe from email list

2 participants