Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Frontend Subscribe Form #35

Open
13 tasks done
david-smejkal opened this issue Mar 12, 2023 · 0 comments
Open
13 tasks done

Feature: Frontend Subscribe Form #35

david-smejkal opened this issue Mar 12, 2023 · 0 comments

Comments

@david-smejkal
Copy link
Contributor

david-smejkal commented Mar 12, 2023

Goal

Implement a way for Birdsong to accept mailing list (campaign) subscriptions from frontend.

Birdsong Frontend Subscribe Form

Implemented the following:

  • create subscribe form template tag (birdsong_subscribe_form)
  • implement /subscribe endpoint that will accept raw form submission requests
  • implement /subscribe_api endpoint that will accept (ajax) json form submission requests
  • prevent duplicate contact creation
  • implement robust error handling to:
    • guard against xss and sql injections
    • utilize Django's and browser's built-in email field validation
  • implement token /activate endpoint
    • send subscription activation urls using BIRDSONG_BACKEND
  • write unit tests
  • write a Subscribe form README section to:
    • demonstrate how to use the new birdsong_subscribe_form template tag
    • list and explain various new subscribe form related settings

Decided not to implement the following (yet):

✘ provide pre / post validation / form submission hooks (both for python and js)
✘ implement a Turing test (let devs choose between reCaptcha and hCaptcha)
✘ implement a 3rd party free opensource API email verification

NOTE:

  • existing birdsong contacts will be automatically activated upon db migration
  • changed birdsong_contact email field to be unique to prevent duplicate subscriptions
    • bumped up version of Birdsong to v1.2.0 (since this is potentially a db breaking change)
  • redefined BaseEmailBackend as an abstract class with two abstract methods (send_campaign() and send_mail())
    • implemented send_mail() in smtp.py birdsong backend
    • bumped up version of Birdsong to v1.2.0 (since this is potentially a breaking change for custom backends)
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

No branches or pull requests

1 participant