sendTest( )


Developer Preview

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

Sends a test email for preview purposes.

It is heavily throttled, so don't use this for regular campaign sending.

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 sendTest(campaignId: string, options: SendTestOptions): Promise<void>;
Method Parameters
campaignIdstringRequired

Campaign ID.


optionsSendTestOptions

Options for sending a test email.

JavaScript
import { campaigns } from "wix-email-marketing.v2"; // Sample campaignId = "ea46013c-bbbf-4617-ad5d-9247bc4c0970"; // Sample options value: // { // "emailSubject": "Hello", // "toEmailAddress": "clientname@email.com", // "language": "en", // "placeholders": {}, // "fromName": "User", // "replyToEmailAddress": "yourname@wix.com" // } export async function mySendTestFunction(campaignId, options) { try { const result = await campaigns.sendTest(campaignId, options); console.log("Success! Your test campaign has been sent."); // return result; } catch (error) { console.error(error); } } /* Promise returns void */
Errors

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

Did this help?