/
/
Email the customers who actually bought the product
For marketers who want a campaign list built from Dynamics GP sales history for one item, with buyers added to Constant Contact by their AI assistant.
On this page
Connector
Connect Microsoft Dynamics GP, pick your AI tool and paste the prompt.
The problem
Product campaigns end up going to the whole list
Emailing the customers who bought one product means a sales history report in Dynamics GP, a hunt for each buyer's email and a check in Constant Contact before anyone is added. Most teams give up partway and send to everyone instead.
Without PopdockAI
- Run a sales history report for the item in Dynamics GP
- Look up each buyer's email on their customer record
- Search Constant Contact for every address one by one
- Give up and send the campaign to the whole list
With PopdockAI
- Each active customer's quantity and spend on the item is totalled for you
- Every buyer's email is checked against the Constant Contact list
- You approve the new contacts before any are created
- Permission is left unset and a capped history is flagged
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** Find the Dynamics GP customers who bought item `{item-number}` in the last `{lookback-days}` days (default 365) and make sure each one is a contact on the Constant Contact list named `{list-name}`, for a targeted campaign. Use GP company `{company}` (empty means the default company). Nothing is written until the user confirms.
**Step 1: Confirm the item in Dynamics GP**
Call `dynamics-gp-get-iv-item` with item-number `{item-number}`. If nothing comes back, call it with item-description.contains `{item-number}`; if several match, list them and stop.
**Step 2: Find the buyers in Dynamics GP**
Call `dynamics-gp-get-rm-sales-line-item` with item-number, document-date.from set to the start of the lookback window and company `{company}`, max-records 500. Group the lines by customer-id: total quantity, total extended-price, last document-date. Then call `dynamics-gp-get-rm-customer` for each customer-id to get customer-name, contact-person, phone-1, main-email-address and inactive. Drop inactive customers.
**Step 3: Find the list in Constant Contact**
Call `constant-contact-get-contact-list` with name.contains `{list-name}`. If none or several match, list the lists and stop. Keep the list-id.
**Step 4: Check each buyer in Constant Contact**
Using the first address in main-email-address, call `constant-contact-get-contact` with email-address. Sort buyers into: already on the list (check with `constant-contact-get-contact-list-member` with list-id and email-address), a contact not on the list, not a contact, and no email in GP.
**Step 5: Confirm**
Show the buyers that will be created as contacts, with quantity and spend, and ask for an explicit yes.
**Step 6: Create the missing contacts in Constant Contact**
For each confirmed buyer call `constant-contact-add-contact` with email, list-id, company-name from GP customer-name, first-name and last-name from GP contact-person, and phone from GP phone-1. Leave permission-to-send empty.
**Step 7: Report**
A table of all buyers with quantity, spend, last purchase date and outcome (created, already on list, contact not on list, no email, failed).
**Rules & Guidelines:**
* Tools whose names start with dynamics-gp are on the dynamics-gp server; tools whose names start with constant-contact are on the constant-contact server.
* The only write tool this prompt may call is `constant-contact-add-contact`, after Step 5.
* Do NOT call `constant-contact-update-contact`, `constant-contact-add-contact-list`, `constant-contact-add-campaign` or any write tool on the dynamics-gp server.
**Validation:**
* If the sales line read was capped at 500, say the buyer list may be incomplete and suggest a shorter lookback.
* If no lines come back, say so and stop.Who it's for
One answer, three teams that use it
Email marketers
Target buyers of one product without an export
Build a list from real Dynamics GP sales history in one message, so an accessory or upgrade offer goes only to the people who own the product.
Add everyone who bought item PR-450 in Dynamics GP in the last six months to the Printer Owners list in Constant Contact.
Product managers
Reach the customers who use what you make
Announce a recall, firmware update or new model to the customers who actually bought the item, with their quantity and spend in view.
Who bought item SD-200 from us last year, and can you add them to our SD-200 Updates list in Constant Contact?
Account managers
See which accounts buy an item before a promotion
Get each buyer's quantity and spend on the item, and see who is already on the list, before a promotion goes out to your accounts.
Show me which Dynamics GP customers bought item CART-12 in the last two years and which of them are missing from the Toner Offers list.
How it works
What PopdockAI does when you ask
You name the item and the list, and your AI assistant builds the buyer list from Dynamics GP sales history and checks it in Constant Contact. No contact is created until you approve.
01
Ask
You give an item number, a Constant Contact list and optionally a lookback period.
02
Find
It confirms the item and totals each active customer's quantity and spend in Dynamics GP.
03
Check
It sorts each buyer's email by list membership in Constant Contact.
04
Confirm
You approve the new contacts, and they are created with permission left unset.
What PopdockAI provides
The tools behind the answer
Ready made tools for Microsoft Dynamics GP and one secure connection to your AI tool. No code, no exports.
microsoft-dynamics-gp-get-iv-item
microsoft-dynamics-gp-get-rm-sales-line-item
microsoft-dynamics-gp-get-rm-customer
constant-contact-get-contact-list
constant-contact-get-contact
constant-contact-get-contact-list-member
constant-contact-add-contact
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
Campaigns that reach the people who bought the product
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
