> 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

# GetComposer

# Package: emailMarketing

# Namespace: CampaignService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/get-composer.md

## Permission Scopes:
Manage Email Marketing: SCOPE.DC-PROMOTE.EMAIL-MARKETING

## Introduction

Retrieves a campaign's editor data, including the content and subject line.

---

## REST API

### Schema

```
 Method: getComposer
 Description: Retrieves a campaign's editor data, including the content and subject line.
 URL: https://www.wixapis.com/email-marketing/v1/campaigns/{campaignId}/composer
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignId
 Method parameters: 
   param name: campaignId | type:   none | required: true 
 Return type: GetComposerResponse
  - name: composer | type: Composer | description: Campaign editor data.  
     - name: composerDataJson | type: string | description: Editor content for the campaign. The format depends on `campaignEditorType`:  - `WEB`: Wix proprietary JSON format used by the drag-and-drop email editor. - `MOBILE`: A subset of the `WEB` format, used by the mobile email editor. - `MJML`: MJML markup wrapped in a JSON object under key "mjml".  Passing the wrong format for the given `campaignEditorType` causes a silent failure when sending or previewing the campaign.  | validation: maxLength 10000000
     - name: defaultValues | type: DefaultValues | description: Fallback values for dynamic placeholders in the campaign content.  
        - name: map | type: object | description: Map of placeholder keys to their default values.  | validation: maxItems 500, format map
  - name: emailSubject | type: string | description: Campaign subject line.  | validation: maxLength 1000
  - name: emailPreheader | type: string | description: Short preview text shown after the subject line in some email clients.  | validation: maxLength 1000


```

### Examples

### Get Composer
Retrieve a campaign's editor data and subject line.

```curl
curl -X GET \
'https://www.wixapis.com/email-marketing/v1/campaigns/943602e1-633b-4577-ab39-43cba3dc17aa/composer' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.emailMarketing.campaigns.getComposer(campaignId)
 Description: Retrieves a campaign's editor data, including the content and subject line.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignId
 Method parameters: 
   param name: campaignId | type: string | description: Campaign GUID. | required: true | validation: format GUID
 Return type: PROMISE<GetComposerResponse>
  - name: composer | type: Composer | description: Campaign editor data.  
     - name: composerDataJson | type: string | description: Editor content for the campaign. The format depends on `campaignEditorType`:  - `WEB`: Wix proprietary JSON format used by the drag-and-drop email editor. - `MOBILE`: A subset of the `WEB` format, used by the mobile email editor. - `MJML`: MJML markup wrapped in a JSON object under key "mjml".  Passing the wrong format for the given `campaignEditorType` causes a silent failure when sending or previewing the campaign.  | validation: maxLength 10000000
     - name: defaultValues | type: DefaultValues | description: Fallback values for dynamic placeholders in the campaign content.  
        - name: map | type: object | description: Map of placeholder keys to their default values.  | validation: maxItems 500, format map
  - name: emailSubject | type: string | description: Campaign subject line.  | validation: maxLength 1000
  - name: emailPreheader | type: string | description: Short preview text shown after the subject line in some email clients.  | validation: maxLength 1000


```

### Examples

### Get a campaign's editor data
Retrieves the composer data, subject line, and preheader for a campaign.

```javascript
import { campaigns } from "@wix/email-marketing";

export async function getComposer(campaignId) {
  const result = await campaigns.getComposer(campaignId);
}

/* Promise resolves to:
 * {
 *   "composer": {
 *     "composerDataJson": "{\"mjml\":\"<mjml><mj-body><mj-section><mj-column><mj-text>Summer Sale! Get 20% off all products this week.</mj-text></mj-column></mj-section></mj-body></mjml>\"}"
 *   },
 *   "emailSubject": "Summer Sale - 20% Off Everything",
 *   "emailPreheader": "Limited time offer inside"
 * }
 */

```

### getComposer (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 { campaigns } from '@wix/email-marketing';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { campaigns },
  // Include the auth strategy and host as relevant
});


async function getComposer(campaignId) {
  const response = await myWixClient.campaigns.getComposer(campaignId);
};
```

---