Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

butkeraites-hotglue
Copy link

  • 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.
@butkeraites-hotglue butkeraites-hotglue marked this pull request as ready for review December 31, 2024 18:41
@@ -7,7 +7,7 @@ class ContactsSink(ActionKitSink):
"""ActionKit target sink class."""

name = "Contacts"
endpoint = "user"
endpoint = "rest/v1/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional?

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)
Copy link
Member

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?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants