Implement a way for Birdsong to accept mailing list (campaign) subscriptions from frontend.
Implemented the following:
[x] create subscribe form template tag (birdsong_subscribe_form)
[x] implement /subscribe endpoint that will accept raw form submission requests
[x] implement /subscribe_api endpoint that will accept (ajax) json form submission requests
[x] prevent duplicate contact creation
[x] implement robust error handling to:
[x] guard against xss and sql injections
[x] utilize Django's and browser's built-in email field validation
[x] implement token /activate endpoint
[x] send subscription activation urls using BIRDSONG_BACKEND
[x] write unit tests
[x] write a Subscribe form README section to:
[x] demonstrate how to use the new birdsong_subscribe_form template tag
[x] 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)
Goal
Implement a way for Birdsong to accept mailing list (campaign) subscriptions from frontend.
Implemented the following:
birdsong_subscribe_form
)/subscribe
endpoint that will accept raw form submission requests/subscribe_api
endpoint that will accept (ajax) json form submission requests/activate
endpointBIRDSONG_BACKEND
Subscribe form
README section to:birdsong_subscribe_form
template tagDecided 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:
birdsong_contact
email field to be unique to prevent duplicate subscriptionsBaseEmailBackend
as an abstract class with two abstract methods (send_campaign()
andsend_mail()
)send_mail()
insmtp.py
birdsong backend