# Create Newsletter — GetResponse

> Creates a new newsletter and puts it in a queue to send. See the docs here

- Key: `getresponse-create-newsletter`
- Type: Action (Write)
- Version: 0.0.2
- App: GetResponse (`getresponse`) — https://pipedream.com/apps/getresponse.md
- This page (HTML): https://pipedream.com/apps/getresponse/actions/create-newsletter
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/getresponse/actions/create-newsletter/create-newsletter.mjs

## Description

Creates a new newsletter and puts it in a queue to send. [See the docs here](https://apireference.getresponse.com/?_ga=2.47520738.499257728.1666974700-2116668472.1666974700&amp;_gl=1*1f3h009*_ga*MjExNjY2ODQ3Mi4xNjY2OTc0NzAw*_ga_EQ6LD9QEJB*MTY2Njk3NzM0Ny4yLjEuMTY2Njk3ODQ3OS4zNi4wLjA.#operation/createNewsletter)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | No | The newsletter name |
| `type` | `string` | No | The newsletter type |
| `campaignId` | `string` | Yes | The campaign ID Options are loaded from the connected account. |
| `subject` | `string` | Yes | The newsletter name |
| `fromFieldId` | `string` | Yes | The From address ID Options are loaded from the connected account. |
| `selectedCampaigns` | `string[]` | Yes | Specify which campaigns you will want the message be deliver to. Options are loaded from the connected account. |
| `selectedContacts` | `string[]` | No | Specify which contacts you will want the message be deliver to. Options are loaded from the connected account. |
| `selectedSegments` | `string[]` | No | Specify which segments you will want the message be deliver to. Options are loaded from the connected account. |
| `contentType` | `string` | Yes | Flag to show either Text Content or HTML Content property |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "getresponse",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "getresponse-create-newsletter",
  arguments: {
    name: "Name",
    type: "Type",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "getresponse-create-newsletter",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    getresponse: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    type: "Type",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "getresponse-create-newsletter",
    "configured_props": {
      "getresponse": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "type": "Type"
    }
  }'
```

---

- App: https://pipedream.com/apps/getresponse.md · All apps: https://pipedream.com/apps
