reuseCampaign( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a (draft) copy of an existing campaign.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Email Marketing
Learn more about app permissions.
Method Declaration
Copy
function reuseCampaign(campaignId: string): Promise<ReuseCampaignResponse>;
Method Parameters
campaignIdstringRequired

ID of the message to be duplicated.

Returns
Return Type:Promise<ReuseCampaignResponse>
JavaScript
import { campaigns } from "wix-email-marketing.v2"; // Sample campaignId = "cc332004-418c-496b-a870-c086790c149d"; export async function myReuseCampaignFunction(campaignId) { try { const result = await campaigns.reuseCampaign(campaignId); console.log("Success! Your campaign has been reused."); return result; } catch (error) { console.error(error); } } /* Promise resolves to: * { * "campaign": { * "campaignId": "cc332004-418c-496b-a870-c086790c149d", * "title": "Announcing a Special Offer", * "firstImageUrl": "https://static.wixstatic.com/media/eceb8e_07a78e49568947ffa34fd4983cdd94ae~mv2.png", * "editorType": "WEB", * "status": "ACTIVE", * "visibilityStatus": "DRAFT", * "distributionStatus": "NOT_STARTED", * "dateCreated": "2023-08-13T05:15:32.000Z", * "dateUpdated": "2023-08-13T05:15:32.868Z", * "sendingState": "DRAFT", * "campaignType": "EMAIL_MARKETING" * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?