-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add postprocessing for email actions and include page_name property #3
base: master
Are you sure you want to change the base?
Conversation
butkeraites-hotglue
commented
Dec 31, 2024
- Implemented postprocess_record method in ContactsSink to create actions based on email and page_name configuration.
- Added page_name property to TargetActionKit for enhanced configuration options.
- Implemented postprocess_record method in ContactsSink to create actions based on email and page_name configuration. - Added page_name property to TargetActionKit for enhanced configuration options.
- Changed the API endpoint for ContactsSink from "user" to "rest/v1/". - Added temporary handling for zip code errors by removing the "zip" field from the record. - Integrated postprocessing of records after successful updates and action creations. - Improved error logging for action creation failures, providing clearer feedback on issues. These changes aim to improve the robustness and clarity of the ContactsSink functionality.
@@ -7,7 +7,7 @@ class ContactsSink(ActionKitSink): | |||
"""ActionKit target sink class.""" | |||
|
|||
name = "Contacts" | |||
endpoint = "user" | |||
endpoint = "rest/v1/" |
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.
Was this intentional?
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.
Yes! Without it I would not be able to add users to the action page
@@ -49,6 +49,9 @@ def upsert_record(self, record: dict, context: dict): | |||
|
|||
if existing_users: | |||
user_id = existing_users[0].get("id") | |||
# TODO:I got {"errors": {"zip": ["Data too long! Please use a smaller value, see the schema for the maximum allowed input"]}}} | |||
# I'm not sure if this is the correct way to handle this, but it's a temporary fix | |||
record.pop("zip", None) |
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.
Doesn't this just mean you were providing an invalid zip
?
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.
It was a valid one and in the schema there wasn't any valuable information on how to handle it... If I let it updating the zip it would break things.