From 51321289379042d689d2170f7aa84450bd964173 Mon Sep 17 00:00:00 2001 From: gzukowski Date: Tue, 23 Jan 2024 12:27:49 +0000 Subject: [PATCH] . --- python/ChimpInsert/config.json | 3 +-- python/ChimpInsert/main.py | 2 +- python/Stripe/main.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/python/ChimpInsert/config.json b/python/ChimpInsert/config.json index fecd2ff..88764d8 100644 --- a/python/ChimpInsert/config.json +++ b/python/ChimpInsert/config.json @@ -1,6 +1,5 @@ { - "slack_api_url" : "", - "slack_channel_id" : "", + "slack_hook_url" : "", "mailchimp_api" : "", "audience_id" : "", "mailchimp_server" : "" diff --git a/python/ChimpInsert/main.py b/python/ChimpInsert/main.py index bd45123..5ea7be5 100644 --- a/python/ChimpInsert/main.py +++ b/python/ChimpInsert/main.py @@ -38,7 +38,6 @@ async def post_slackMSG(self, text): try: response = requests.post(self.slack_api_url, headers=self.token_header, data=str({"text":f"{text}"})) except Exception as error: - self.logger.error("ChimpInsert: Failed to send a request to slack.") return SlackHookResponse.FAILURE.value if response.status_code != SlackHookResponse.SUCCESS.value: @@ -114,6 +113,7 @@ async def insert_info(self, info): return response = self.mailchimp.lists.update_list_member(self.audience_id, user_id, {"status" : "subscribed"}) self.logger.info(f"ChimpInsert: {email} Auth0 user with newsletter successfully added") + slack_message_resp = await self.post_slackMSG("Auth0 user with newsletter successfully added") elif TopicInfo.STRIPE.value in lname: response = self.mailchimp.lists.get_list_members_info(self.audience_id, offset=self.get_offset(self.audience_id)) diff --git a/python/Stripe/main.py b/python/Stripe/main.py index 3b7b43f..f55e83c 100644 --- a/python/Stripe/main.py +++ b/python/Stripe/main.py @@ -51,6 +51,5 @@ async def run(context, input): stripeReader = Stripe(stream, stripe.api_key, context.logger) except Exception as error: raise Exception(f"Config not loaded: {error}") - return asyncio.gather(stripeReader.get_event(), return_exceptions=True) return stream.map(lambda x : x + "\n") \ No newline at end of file