> 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: getCampaign(campaignId: string, options: GetCampaignOptions) # Method package: wixEmailMarketingV2 # Method menu location: wixEmailMarketingV2 --> campaigns --> getCampaign # Method Link: https://dev.wix.com/docs/velo/apis/wix-email-marketing-v2/campaigns/get-campaign.md # Method Description: Retrieves information about an email campaign. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Gets email campaign by ID (dashboard page code) ```javascript import { campaigns } from 'wix-email-marketing.v2'; // Sample campaignId value: 'ff61204b-b19a-5cc8-823b-7eed8ae5fc28' // Sample options value: // { // optionIncludeStatistics: true, // } export async function myGetCampaignFunction(campaignId, options) { try { const result = campaigns.getCampaign(campaignId, options); console.log('Success! Retrieved results:', result); return result; } catch (error) { console.error(error); } } /* Promise resolves to: * { * "campaign":{ * "campaignId": "b98a4436-10f5-47bd-9c6f-370962adfe54", * "title": "A New Tutorial for You", * "firstImageUrl": "https://static.wixstatic.com/media/6191b8_77d27f7d028a4b50850b7f92dadcd578~mv2.png", * "editorType": "WEB", * "status": "ACTIVE", * "visibilityStatus": "PUBLISHED", * "distributionStatus": "DISTRIBUTED", * "publishingData": { * "landingPageUrl": "https://shoutout.wix.com/so/54OdUqUrf?languageTag=en", * "statistics": { * "landingPage": { * "opened": 150, * "clicked": 80 * }, * "emailCampaign": { * "delivered": 700, * "opened": 200, * "clicked": 0, * "bounced": 0, * "complained": 0, * "notSent": 0 * }, * "total": { * "mailsSent": 1, * "opened": 200, * "clicked": 500 * } * }, * "datePublished": "2023-08-10T09:40:59.000Z", * "wasResentToNonOpeners": false * }, * "dateCreated": "2023-08-10T09:40:47.000Z", * "dateUpdated": "2023-08-10T09:40:59.045Z", * "sendingState": "SENT", * "campaignType": "EMAIL_MARKETING" * } * } */ ``` ## Gets email campaign by ID (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { campaigns } from 'wix-email-marketing.v2'; // Sample campaignId value: 'ff61204b-b19a-5cc8-823b-7eed8ae5fc28' // Sample options value: // { // optionIncludeStatistics: true, // } export const myGetCampaignFunction = webMethod(Permissions.Anyone, async (campaignId, options) => { try { const result = campaigns.getCampaign(campaignId, options); console.log('Success! Retrieved results:', result); return result; } catch (error) { console.error(error); } }); /* Promise resolves to: * { * "campaign":{ * "campaignId": "b98a4436-10f5-47bd-9c6f-370962adfe54", * "title": "A New Tutorial for You", * "firstImageUrl": "https://static.wixstatic.com/media/6191b8_77d27f7d028a4b50850b7f92dadcd578~mv2.png", * "editorType": "WEB", * "status": "ACTIVE", * "visibilityStatus": "PUBLISHED", * "distributionStatus": "DISTRIBUTED", * "publishingData": { * "landingPageUrl": "https://shoutout.wix.com/so/54OdUqUrf?languageTag=en", * "statistics": { * "landingPage": { * "opened": 150, * "clicked": 80 * }, * "emailCampaign": { * "delivered": 700, * "opened": 200, * "clicked": 0, * "bounced": 0, * "complained": 0, * "notSent": 0 * }, * "total": { * "mailsSent": 1, * "opened": 200, * "clicked": 500 * } * }, * "datePublished": "2023-08-10T09:40:59.000Z", * "wasResentToNonOpeners": false * }, * "dateCreated": "2023-08-10T09:40:47.000Z", * "dateUpdated": "2023-08-10T09:40:59.045Z", * "sendingState": "SENT", * "campaignType": "EMAIL_MARKETING" * } * } */ ``` ---