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

email-exporter: Initial implementation #7998

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

beautifulentropy
Copy link
Member

@beautifulentropy beautifulentropy commented Feb 6, 2025

TODO:

  • Add an integration mock of the Pardot API
  • Add email-exporter to startservers
  • Add email-exporter service to WFE config
  • Implement email dispatch in the WFE
  • Add integration tests
  • Add unit tests

@beautifulentropy beautifulentropy force-pushed the add-email-exporter branch 4 times, most recently from 46c78d6 to 60a6e94 Compare February 7, 2025 16:15
email/pardot.go Outdated

// prospectsPath is the path to the Pardot v5 Prospects endpoint. This
// endpoint will create a new Prospect if one does not already exist.
prospectsPath = "/api/v5/prospects"
Copy link
Contributor

Choose a reason for hiding this comment

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

Two questions:

  1. This doesn't include the /objects/ part of the path that I see in the docs -- is that not necessary?
  2. This is used to create what many other comments call the "upsert path", but doesn't include the /do/upsertLatestByEmail suffix that the docs indicate is used for upserting -- is that also not necessary?

Copy link
Member Author

@beautifulentropy beautifulentropy Feb 12, 2025

Choose a reason for hiding this comment

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

  1. This doesn't include the /objects/ part of the path that I see in the docs -- is that not necessary?

Does this interpretation of this article align with yours?

Third-Party Connectors
Some third-party connectors rely on the email address to sync data from the third party into Account Engagement. When we bring in data from these connectors, we look for matching prospects with the same email address.
If only one prospect has that email address, the activity is saved to that record. If more than one prospect has the email address, the activity is saved to the prospect that has the most recent activity. If no active prospects have that email address, we attempt to match a record in the recycle bin and undelete the record if found. If we can’t find any prospects with the given email address, we create a prospect and saves the activity to the new record.

From this, it seems that unless another lookup field is specified, prospect creation inherently deduplicates by email (the only required field).

This appears consistent with the intention of Prospect Upsert by Email:

This procedure updates single prospect with the given email address with the specified prospect fields. If multiple prospects have the given email, the prospect with the latest activity is updated. If there’s no prospect with the given email, a prospect is created.

I went this route because using the upsert endpoint like this, felt off:

{
    "matchEmail": "[email protected]",
    "prospect": {
        "email": "[email protected]",
     },
    "fields": ["id", "email"]
}

That led me to wonder why duplicates would even be allowed, given that email is the only required Prospect field. We will definitely test this before we go live, but I think my understanding is correct.

  1. This is used to create what many other comments call the "upsert path", but doesn't include the /do/upsertLatestByEmail suffix that the docs indicate is used for upserting -- is that also not necessary?

You're right, I've gone ahead and updated this code to remove any mention of upserting. Whether or not we use the uspert endpoint I don't think it's relevant to incorporate "Upsert" into the Boulder-facing API.

email/pardot.go Show resolved Hide resolved
email/pardot.go Outdated Show resolved Hide resolved
email/pardot.go Outdated Show resolved Hide resolved
email/pardot.go Outdated Show resolved Hide resolved
email/exporter.go Outdated Show resolved Hide resolved
email/exporter.go Outdated Show resolved Hide resolved
email/exporter.go Outdated Show resolved Hide resolved
email/exporter.go Show resolved Hide resolved
cmd/email-exporter/main.go Outdated Show resolved Hide resolved
@beautifulentropy beautifulentropy force-pushed the add-email-exporter branch 3 times, most recently from 622f2fa to 56e9364 Compare February 12, 2025 22:53
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