This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates sender details.
If the fromEmail
is changed, a verification code will be sent to the new email address.
If verification is needed, a verification email will be sent to the user, and the returned verificationNeeded
value will be true
.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function updateSenderDetails(
senderDetails: SenderDetails,
): Promise<UpdateSenderDetailsResponse>;
New sender details.
import { senderDetails } from "wix-email-marketing.v2";
// Sample object:
// {
// "senderDetails": {
// "fromName": "User",
// "fromEmail": "newemail@address.com"
// }
// }
export async function myUpdateSenderDetailsFunction(senderDetails) {
try {
const result = await senderDetails.updateSenderDetails;
console.log(`Success! SenderDetails updated.`);
return result;
} catch (error) {
console.error(error);
}
}
/* Promise returns:
* {
* verificationNeeded: true
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.