diff --git a/adrs/madr-fxa-ctms.md b/adrs/madr-fxa-ctms.md new file mode 100644 index 00000000..f0a3b448 --- /dev/null +++ b/adrs/madr-fxa-ctms.md @@ -0,0 +1,28 @@ +# Stripe Subscription Event Data Empowering Email User Journeys + +* Status: proposed +* Deciders: Bryan Sieber, John Whitlock, Ben Bangert, Jon Buckley, (Benson Wong, Stephen Hood) +* Date: September 30, 2021 + +Technical Story: [design and document approach for marketing | https://mozilla-hub.atlassian.net/jira/software/c/projects/CTMS/boards/364?modal=detail&selectedIssue=CTMS-73] + +## Context and Problem Statement + +Marketing wants to be able to differentiate customers based on their subscription information to empower marketing campaigns. + +## Decision Drivers + +* Design sustainable system for longterm data-health +* FxA source of Truth +* Stripe rate limits + + +## Considered Options + +* Cloud Function triggered through Firestore +* Background process in CTMS +* New temporary service + +## Decision Outcome + +Chosen option: " Cloud Function triggered through Firestore", because the event snapshots can be captured and published to a Pub/Sub, upon which they can be pushed to CTMS with a JWT. We believe this is a more sustainable option. diff --git a/diagrams/subscription_event_stream_to_CTMS.svg b/diagrams/subscription_event_stream_to_CTMS.svg new file mode 100644 index 00000000..77fc5763 --- /dev/null +++ b/diagrams/subscription_event_stream_to_CTMS.svg @@ -0,0 +1,3 @@ + + +
Google Cloud Platform
Google Cloud Platform
Stripe
Webhooks
Stripe...
FxA Service
FxA Service
FxA Firestore
Cloud Firestore
FxA Fire...
FirestoreSnapshotToPubsub
Cloud Functions
publish snapshot changes
Firestor...
FxAFirestoreEvents
Cloud Pub/Sub
with Push Subscription
FxAFires...
CTMS
CTMS
JWT
JWT
Architecture: Stripe Webhook Event Data Flow
This yellow indicates FxA
team commitments
This yellow indicates FxA...
This green indicates CTMS
team commitments
This green indicates CTMS...
blue solid arrow = sync calls
orange dotted arrow = async calls
blue solid arrow = sync calls...
Viewer does not support full SVG 1.1