Skip to content

Commit

Permalink
wip Fix #1392 stash Convertkit until self-service onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsimpson committed Aug 25, 2024
1 parent c746c50 commit a6a7ec8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions subscribie/receivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,30 @@ def receiver_new_subscriber(*args, **kwargs):
newSubscriberEmailNotification(**kwargs)


def receiver_new_subscriber_add_to_convertkit()
subscription_uuid = kwargs.get("subscription_uuid")
subscription = None
try:
subscription = (
Subscription.query.where(Subscription.uuid == subscription_uuid)
.execution_options(include_archived=True)
.one()
)
subscriber_email = subscription.person.email
except sqlalchemy.exc.NoResultFound:
if subscription is None and subscription_uuid != "test":
msg = "Got receiver_new_subscriber_add_to_convertkit event but no associated subscription found." # noqa: E501
log.error(msg)
return
elif subscription_uuid == "test":
log.info("Testing receiver_new_subscriber_add_to_convertkit with dummy subscription")
subscriber_email = "test-subscriber@example.com"



create_convertkit_subscriber_enttry_name_thihng()


def receiver_new_donation(*args, **kwargs):
to_email = kwargs.get("email")
send_donation_thankyou_email(to_email=to_email)
2 changes: 2 additions & 0 deletions subscribie/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
receiver_new_subscriber,
receiver_new_donation,
receiver_attach_documents_to_subscription,
receiver_new_subscriber_add_to_convertkit
)

# Subscribie Core signals. For usage examples grep the source code
Expand Down Expand Up @@ -52,3 +53,4 @@ def register_signal_handlers():
receiver_send_subscriber_payment_failed_notification_email
)
signal_new_donation.connect(receiver_new_donation)
signal_journey_complete.connect(receiver_new_subscriber_add_to_convertkit)

0 comments on commit a6a7ec8

Please sign in to comment.