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

New Step: Check list membership #34

Open
iamEAP opened this issue Mar 31, 2020 · 1 comment
Open

New Step: Check list membership #34

iamEAP opened this issue Mar 31, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@iamEAP
Copy link
Contributor

iamEAP commented Mar 31, 2020

What / Why

As a Crank user, I should be able to check that a Pardot Prospect is a member of a list and whether or not the Prospect is opted out.

Proposed Step Name: Check Pardot List Membership
Proposed Step Expression: the (?<email>.+) pardot prospect should (?<optInOut>(be opted in to|be opted out of|not be a member of)) list (?<listId>.+)

Proposed Step Fields:

  • email (type EMAIL), the email address of the prospect
  • optInOut (type STRING), one of be opted in to, be opted out of, or not be a member of
  • listId (type NUMERIC), the ID of the pardot list

Proposed Step Records

  • listMembership (type KeyValue, named List Membership), returned regardless of outcome anytime a ListMembership record is found. Guaranteed fields should include:
    • id (type NUMERIC)
    • list_id (type NUMERIC)
    • prospect_id (type NUMERIC)
    • opted_out (type BOOLEAN)
    • created_at (type DATETIME)
    • updated_at (type DATETIME)

Proposed Resolution

  • Load the prospect for the given email address and note its ID.
  • Query list memberships for the given listId and prospectId

Outcomes

  • When optInOut is set to be opted in to
    • If no ListMembership is found, the step should fail: Prospect %s is not a member of list %d.
    • The step should pass if a ListMembership is found and opted_out field is false-y (e.g. not set or false or 0)
    • If the opted_out property is truth-y, the step should fail: Expected prospect %s to be opted in to list %d, but the prospect is opted out.
  • When optInOut is set to be opted out of
    • If no ListMembership is found, the step should fail: Prospect %s is not a member of list %d.
    • The step should pass if a ListMembership is found and opted_out is truth-y (e.g. set to 1).
    • If the opted_out property is false-y, the step should fail: Expected prospect %s to be opted out of list %d, but the prospect is opted in.
  • When the optInOut is set to not be a member of
    • If no ListMembership is found, the step should pass.
    • If a ListMemberShip is found, regardless of its opted_out property, the step should fail: Expected prospect %s to not be a member of list %d, but a list membership was found.
  • In any case, if there is no prospect for the given email address, the step should result in an error: No prospect found for email %s
@iamEAP iamEAP added the enhancement New feature or request label Mar 31, 2020
@iamEAP
Copy link
Contributor Author

iamEAP commented Apr 2, 2020

Some sample UAT scenarios:

scenario: Static List Membership
description: Proves list membership check works for static lists

tokens:
  test.email: [email protected]

steps:
- step: Given I navigate to http://go.pardot.com/l/811013/2019-10-16/3mxyx
- step: And I fill out .qat-email-address input with {{test.email}}
- step: And I submit the form by clicking input[type="submit"]
- step: When I navigate to http://go.pardot.com/emailPreference/e/epc/811013/73l8a8WE9ADUxfXqsuccHNdSbUtyYnSPsF84xjhVW0g/411
- step: And I fill out input#list_20395 with 1
- step: And I submit the form by clicking input[type="submit"]
- step: Then the {{test.email}} Pardot Prospect should be opted in to list 20395
- step: Finally, delete the {{test.email}} Pardot Prospect
scenario: Dynamic List Membership
description: Proves list membership check works for dynamic lists

tokens:
  test.email: [email protected]

steps:
- step: Given I create a Pardot Prospect
  data:
    prospect:
      email: '{{test.email}}'
      utm_campaign: DynamicSubscribe
- step: Then the {{test.email}} Pardot Prospect should be opted in to list 20397
- step: Finally, delete the {{test.email}} Pardot Prospect

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

No branches or pull requests

1 participant