-
Notifications
You must be signed in to change notification settings - Fork 72
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
Sovrn Email Consent Connector #2543
Conversation
…tor. - Adds a new connector type - Adds new email template and definitions to populate that template - Defines a new limited connector that only has the test request functionality - Adds a new step to the request runner to send the consent emails for non-disabled connectors, just before the post-execution webhooks step.
…ut keep the generic email connector code around so this can be re-used later. - Add a new provided identity type of ljt_readerID. - Add a privacy request status of "awaiting_consent_email_send" (currently unused) - Update the consent email template to assume multiple users identity data and consent preferences could be passed in. - Create a SovrnEmailSchema that hardcodes third_party_vendor_name and recipient_email_address. Also sets the browser_identity_type by default on the backend while we restrict making these changes in the UI. - Dry up the email send so we're firing the same code between the test email and privacy request email send. - Add an optional subject_override to dispatch_message, in case the email subject contains data that cannot be known up-front.
…th awaiting email send status, and is then picked up by periodic task scheduled with celery beat. This commit tries to send the email each minute for testing purposes and assumes you have a worker running.
…lSchema inherit from the BaseModel. The original ConnectionConfigSecretsSchema has logic to either allow a URL -or- one of the required components, which isn't really applicable here.
… and associated methods. Give identity_types and browser_identity_types default values of [].
…t into smaller self-explanatory functions.
…s need a consent email send, for subject override, and for multiple user data being combined.
…always_eager"=True. I have not gotten periodic tasks to work in that case. - Adds scheduler function to consent batch email service for circular import reasons - Add additional logging.
Also use the new get_new_session method.
Codecov ReportBase: 85.95% // Head: 86.26% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2543 +/- ##
==========================================
+ Coverage 85.95% 86.26% +0.30%
==========================================
Files 285 289 +4
Lines 15540 15823 +283
Branches 1959 1997 +38
==========================================
+ Hits 13358 13650 +292
+ Misses 1799 1785 -14
- Partials 383 388 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…assert sovrn email send and scenario when one email connector doesn't have data to send.
…read" connection configs.
clients/admin-ui/src/features/datastore-connections/add-connection/constants.ts
Show resolved
Hide resolved
…ey to a data use name if possible before sending in the email.
src/fides/api/ops/schemas/connection_configuration/connection_secrets_sovrn.py
Outdated
Show resolved
Hide resolved
src/fides/api/ops/service/privacy_request/consent_email_batch_service.py
Show resolved
Hide resolved
src/fides/api/ops/service/privacy_request/consent_email_batch_service.py
Show resolved
Hide resolved
Passing run #167 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whew, awesome work!! tested it with your instructions and everything worked as expected 💯
src/fides/api/ctl/migrations/versions/8e198eb13802_add_sovrn_consent_connector.py
Show resolved
Hide resolved
src/fides/api/ops/schemas/connection_configuration/connection_secrets_email_consent.py
Show resolved
Hide resolved
Conflicts: - tests/ops/service/messaging/message_dispatch_service_test.py
Failing test is unrelated to this work and being addressed separately here: https://github.com/ethyca/fides/pull/2596/files#r1107779266 |
Closes #2394
❗
UI doesn't yet have handling for this new connector type; do not merge❗ Contains migration; check if downrev needs to be bumped before merge
Code Changes
Database
sovrn
connection type enumawaiting_consent_email_send
PrivacyRequest.awaiting_consent_email_send_at
fieldprovidedidentitytype
:sovrn
Email types
Connector (Connectors contain the logic to reach out to other services)
GenericEmailConsentConnector
that could be used for any consent email type connector. (This is not yet exposed as an option).SovrnConsentConnector
that uses theGenericEmailConsentConnector
. These are new LimitedConnector types that don't interact directly with datasets, and just need to define how to make test connections.ConnectionConfig (ConnectionConfigs describe the details needed to configure a service)
sovrn
connectionconfig that needstest_email_address
, andadvanced_settings
supplied.Scheduler
initiate_scheduled_batch_consent_email_send
that runs weekly on Mondays 12:00 PM ET to see if there are any consent emails that need to be sent and batches all the data accumulated in the last week into a single email per connector.Connection Type
Steps to Confirm
advertising.first_party
is Truedocument.cookie = "ljt_readerID=fides_test_reader_id;";
nox -s "fides_env(dev)"
(make sure your privacy center changes take too. You may need to donox -s "build(privacy-center)"
anddocker-compose up -d --no-deps fides-pc
if not.{{host}}/messaging/config/
{{host}}/messaging/config/{{mailgun_config_key}}/secret
2023-02-09 15:38:00.067 [INFO] (consent_email_batch_service:send_consent_email_batch:172): Skipping batch consent email send with status: no_applicable_privacy_requests```
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
Largely this adds a new Consent Email Connector (Sovrn) with plenty of foundation that can be reused for generic or vendor-specific email connectors in the future. Instead of sending the emails immediately, relevant data is batched together and sent in a single email to the vendor weekly.
awaiting consent email send
state if certain conditions are met:initiate_scheduled_batch_consent_email_send
that handles the weekly email send with APSchedulerawaiting consent email send
status. It then batches all the relevant user data together across all these privacy requests for each type of email consent connector.