> 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 # CreateSenderEmail # Package: emails # Namespace: SenderEmailService # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sender-emails/create-sender-email.md ## Permission Scopes: Access Verticals by Automations: SCOPE.CRM.ACCESS-VERTICALS-BY-AUTOMATIONS ## Introduction Creates a sender email. --- ## REST API ### Schema ``` Method: createSenderEmail Description: Creates a sender email. URL: https://www.wixapis.com/sender-emails/v1/sender-emails Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: senderEmail, senderEmail.emailAddress Method parameters: param name: senderEmail | type: SenderEmail | required: true - name: emailAddress | type: string | description: Sender email address. | required: true - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender emails. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: CreateSenderEmailResponse - name: senderEmail | type: SenderEmail | description: The created sender email. - name: id | type: string | description: Sender email GUID. - name: createdDate | type: string | description: Date and time the sender email was created. - name: updatedDate | type: string | description: Date and time the sender email was last updated. - name: emailAddress | type: string | description: Sender email address. - name: verified | type: boolean | description: Whether the sender email is verified. - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender emails. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Possible Errors: HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: DUPLICATE | Description: There is already a sender email with this email address. ``` ### Examples ### CreateSenderEmail ```curl ~~~cURL curl -X POST 'https://www.wixapis.com/sender-emails/v1/sender-emails' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "senderEmail": { "emailAddress": "john.doe@example.com" } }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.emails.SenderEmailService.createSenderEmail(senderEmail) Description: Creates a sender email. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: senderEmail, senderEmail.emailAddress Method parameters: param name: senderEmail | type: SenderEmail | required: true - name: emailAddress | type: string | description: Sender email address. | required: true - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender emails. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: PROMISE - name: _id | type: string | description: Sender email GUID. - name: _createdDate | type: Date | description: Date and time the sender email was created. - name: _updatedDate | type: Date | description: Date and time the sender email was last updated. - name: emailAddress | type: string | description: Sender email address. - name: verified | type: boolean | description: Whether the sender email is verified. - name: extendedFields | type: ExtendedFields | description: Extensions allowing users to save custom data related to the sender emails. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Possible Errors: HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: DUPLICATE | Description: There is already a sender email with this email address. ``` ### Examples ### createSenderEmail ```javascript import { senderEmails } from '@wix/sender-emails'; async function createSenderEmail(senderEmail) { const response = await senderEmails.createSenderEmail(senderEmail); }; ``` ### createSenderEmail (with elevated permissions) ```javascript import { senderEmails } from '@wix/sender-emails'; import { auth } from '@wix/essentials'; async function myCreateSenderEmailMethod(senderEmail) { const elevatedCreateSenderEmail = auth.elevate(senderEmails.createSenderEmail); const response = await elevatedCreateSenderEmail(senderEmail); } ``` ### createSenderEmail (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { senderEmails } from '@wix/sender-emails'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { senderEmails }, // Include the auth strategy and host as relevant }); async function createSenderEmail(senderEmail) { const response = await myWixClient.senderEmails.createSenderEmail(senderEmail); }; ``` ---