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.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function sendTest(campaignId: string, options: SendTestOptions): Promise<void>;
Campaign ID.
Options for sending a test email.
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 */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.