> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: listRecipients(campaignId: string, activity: RecipientsActivityEnum, options: ListRecipientsOptions) # Method package: wixEmailMarketingV2 # Method menu location: wixEmailMarketingV2 --> campaigns --> listRecipients # Method Link: https://dev.wix.com/docs/velo/apis/wix-email-marketing-v2/campaigns/list-recipients.md # Method Description: Retrieves a list of recipients for a selected campaign based on a specific recipient activity. Pages are returned with a maximum of 1,000 recipients per page and defaults to 40 recipients per page. Use [List Statistics](#liststatistics) to retrieve a list of activity for selected campaigns. Use [List Campaigns](#listcampaigns) to retrieve additional information for your campaigns. If no `activity` is included, this endpoint returns an error. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Retrieves a list of recipients for a selected campaign based on a specific recipient activity (dashboard page code) ```javascript import { campaigns } from 'wix-email-marketing.v2'; // Sample campaignId = 'ea46013c-bbbf-4617-ad5d-9247bc4c0970'; // Sample activity = 'OPENED'; // Sample options value: // { // paging: { // cursor: "string", // limit: 2, // } // } export async function myListRecipientsFunction(campaignId, activity, options) { try { const result = await campaigns.listRecipients(campaignId, activity, options); console.log("Success! Recipients found.") return result; } catch (error) { console.error(error); } } /* Promise returns: * { * "recipients": [ * { * "contactId": "cbdf2bf6-85fb-4b27-b7e3-deb7601a6d47", * "lastActivityDate": "2023-08-12T09:05:20.000Z" * } * ], * "pagingMetadata": { * "count": 1, * "tooManyToCount": true * } * } */ ``` ## Retrieves a list of recipients for a selected campaign based on a specific recipient activity (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { campaigns } from 'wix-email-marketing.v2'; // Sample campaignId = 'ea46013c-bbbf-4617-ad5d-9247bc4c0970'; // Sample activity = 'OPENED'; // Sample options value: // { // paging: { // cursor: "string", // limit: 2, // } // } export const myListRecipientsFunction = webMethod(Permissions.Anyone, async (campaignId, activity, options) => { try { const result = await campaigns.listRecipients(campaignId, activity, options); console.log("Success! Recipients found.") return result; } catch (error) { console.error(error); } }); /* Promise returns: * { * "recipients": [ * { * "contactId": "cbdf2bf6-85fb-4b27-b7e3-deb7601a6d47", * "lastActivityDate": "2023-08-12T09:05:20.000Z" * } * ], * "pagingMetadata": { * "count": 1, * "tooManyToCount": true * } * } */ ``` ---