Skip to content

CV2-6701: Check newsletter: add limits#2419

Merged
melsawy merged 8 commits intodevelopfrom
CV2-6701-check-newsletter-add-limits
Apr 8, 2026
Merged

CV2-6701: Check newsletter: add limits#2419
melsawy merged 8 commits intodevelopfrom
CV2-6701-check-newsletter-add-limits

Conversation

@melsawy
Copy link
Copy Markdown
Contributor

@melsawy melsawy commented Apr 5, 2026

Description

Add controls and limits to the newsletter feature due to new costs:

Add two new fields to Team.settings:

  • tipline_newsletter_enabled (boolean, default: false)
  • tipline_newsletter_subscribers_limit (number or nil; nil means no limit; default: nil)
  • Document how to use these fields in Confluence (Engineering Cookbook)

Add a migration rake task to enable the newsletter feature for:

  • Workspaces using it for non-WhatsApp tiplines (still free)
  • WhatsApp tiplines explicitly approved/requested by Shalini
  • Update the newsletter Sidekiq worker to check whether the feature is enabled for the workspace before sending, and to restrict number of recipients if needed
  • On the frontend, hide Newsletter settings when the feature is not enabled

References: CV2-6701

How to test?

Implement unit tests

Checklist

  • I have performed a self-review of my code and ensured that it is safe and runnable, that code coverage has not decreased, and that there are no new Code Climate issues. I have also followed Meedan's internal coding guidelines.

@melsawy melsawy marked this pull request as ready for review April 7, 2026 19:04
Copy link
Copy Markdown
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

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

Thanks, Sawy! From my side, the only blocker is the each / find_each thing. Did you test the migration locally? Were you able to cover all 3 cases with the data you have in your local database?

@melsawy
Copy link
Copy Markdown
Contributor Author

melsawy commented Apr 8, 2026

Thanks, Sawy! From my side, the only blocker is the each / find_each thing. Did you test the migration locally? Were you able to cover all 3 cases with the data you have in your local database?

Yes Caio

@melsawy melsawy requested a review from caiosba April 8, 2026 06:33
Copy link
Copy Markdown
Contributor

@caiosba caiosba left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the change requests!

@melsawy melsawy merged commit 39b8fdc into develop Apr 8, 2026
10 checks passed
@melsawy melsawy deleted the CV2-6701-check-newsletter-add-limits branch April 8, 2026 16:14
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.

2 participants