> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.front.message.CreateMessage

- Component: `appmixer.front.message.CreateMessage`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.front 1.1.1](https://connectors.appmixer.com/connector/appmixer.front/1.1.1.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.front/1.1.1/component/appmixer.front.message.CreateMessage>

Send a new message from a channel. This creates a new conversation with both messages and comments support.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Channel ID (`channelId`) | text | The ID of the channel from which to send the message |
| To (Recipients) (`to`) | text | Comma-separated list of recipient email addresses |
| Body (`body`) | textarea | The body of the message (plain text or HTML) |
| Author ID (`authorId`) | text | The teammate ID of the message author |
| Sender Name (`senderName`) | text | Name to display as the sender |
| Subject (`subject`) | text | The subject line of the message |
| CC (`cc`) | text | Comma-separated list of CC email addresses |
| BCC (`bcc`) | text | Comma-separated list of BCC email addresses |
| Tags (`tags`) | text | Comma-separated list of tags for the message |
| Archive (`archive`) | toggle | Archive the conversation right when sending the message |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Message ID (`id`) | string | - |
| Message UID (`message_uid`) | string | - |
| Type (`type`) | string | - |
| Is Inbound (`is_inbound`) | boolean | - |
| Is Draft (`is_draft`) | boolean | - |
| Created At (`created_at`) | number | - |
| Blurb (`blurb`) | string | - |
| Body (`body`) | string | - |
| Text (`text`) | string | - |
| Error Type (`error_type`) | string,null | - |
| Version (`version`) | string | - |
| Subject (`subject`) | string | - |
| Draft Mode (`draft_mode`) | string | - |
| Metadata (`metadata`) | object | - |
| Author (`author`) | object | - |
| Recipients (`recipients`) | array | - |
| Attachments (`attachments`) | array | - |
| Signature (`signature`) | object | - |
| Conversation Reference (`conversation_reference`) | string,null | - |
| Status (`status`) | string | - |
| Links (`_links`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.front.message.CreateMessage",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Send a new message from a channel. This creates a new conversation with both messages and comments support.",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:front"
  },
  "quota": {
    "manager": "appmixer:front",
    "resources": "requests"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "channelId": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "senderName": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "cc": {
            "type": "string"
          },
          "bcc": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tags": {
            "type": "string"
          },
          "archive": {
            "type": "boolean"
          }
        },
        "required": [
          "channelId",
          "to",
          "body"
        ]
      },
      "inspector": {
        "inputs": {
          "channelId": {
            "type": "text",
            "label": "Channel ID",
            "index": 0,
            "tooltip": "The ID of the channel from which to send the message"
          },
          "to": {
            "type": "text",
            "label": "To (Recipients)",
            "index": 1,
            "tooltip": "Comma-separated list of recipient email addresses"
          },
          "body": {
            "type": "textarea",
            "label": "Body",
            "index": 2,
            "tooltip": "The body of the message (plain text or HTML)"
          },
          "authorId": {
            "type": "text",
            "label": "Author ID",
            "index": 3,
            "tooltip": "The teammate ID of the message author",
            "source": {
              "url": "/component/appmixer/front/teammates/ListTeammates?outPort=out",
              "data": {
                "message": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./ListTeammates#toSelectArray"
              }
            }
          },
          "senderName": {
            "type": "text",
            "label": "Sender Name",
            "index": 4,
            "tooltip": "Name to display as the sender"
          },
          "subject": {
            "type": "text",
            "label": "Subject",
            "index": 5,
            "tooltip": "The subject line of the message"
          },
          "cc": {
            "type": "text",
            "label": "CC",
            "index": 6,
            "tooltip": "Comma-separated list of CC email addresses"
          },
          "bcc": {
            "type": "text",
            "label": "BCC",
            "index": 7,
            "tooltip": "Comma-separated list of BCC email addresses"
          },
          "tags": {
            "type": "text",
            "label": "Tags",
            "index": 8,
            "tooltip": "Comma-separated list of tags for the message"
          },
          "archive": {
            "type": "toggle",
            "label": "Archive",
            "index": 9,
            "defaultValue": true,
            "tooltip": "Archive the conversation right when sending the message"
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Message ID",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "msg_1q15qmtq"
          }
        },
        {
          "label": "Message UID",
          "value": "message_uid",
          "schema": {
            "type": "string",
            "example": "4f2b9c1e7a8d"
          }
        },
        {
          "label": "Type",
          "value": "type",
          "schema": {
            "type": "string",
            "example": "email"
          }
        },
        {
          "label": "Is Inbound",
          "value": "is_inbound",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Is Draft",
          "value": "is_draft",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Created At",
          "value": "created_at",
          "schema": {
            "type": "number",
            "example": 1717430400
          }
        },
        {
          "label": "Blurb",
          "value": "blurb",
          "schema": {
            "type": "string",
            "example": "Thanks for reaching out. The updated quote is attached."
          }
        },
        {
          "label": "Body",
          "value": "body",
          "schema": {
            "type": "string",
            "example": "<p>Hi Jane,</p><p>Thanks for reaching out. The updated quote is attached.</p>"
          }
        },
        {
          "label": "Text",
          "value": "text",
          "schema": {
            "type": "string",
            "example": "Hi Jane,\n\nThanks for reaching out. The updated quote is attached."
          }
        },
        {
          "label": "Error Type",
          "value": "error_type",
          "schema": {
            "type": [
              "string",
              "null"
            ],
            "example": null
          }
        },
        {
          "label": "Version",
          "value": "version",
          "schema": {
            "type": "string",
            "example": "3c9e1a7b-26028-1717430400000-945c"
          }
        },
        {
          "label": "Subject",
          "value": "subject",
          "schema": {
            "type": "string",
            "example": "Updated quote for June"
          }
        },
        {
          "label": "Draft Mode",
          "value": "draft_mode",
          "schema": {
            "type": "string",
            "example": "shared"
          }
        },
        {
          "label": "Metadata",
          "value": "metadata",
          "schema": {
            "type": "object",
            "example": {}
          }
        },
        {
          "label": "Author",
          "value": "author",
          "schema": {
            "type": "object",
            "example": {
              "_links": {
                "self": "https://api2.frontapp.com/teammates/tea_6r55a",
                "related": {
                  "inboxes": "https://api2.frontapp.com/teammates/tea_6r55a/inboxes",
                  "conversations": "https://api2.frontapp.com/teammates/tea_6r55a/conversations"
                }
              },
              "id": "tea_6r55a",
              "email": "michael.scott@example.com",
              "username": "mscott",
              "first_name": "Michael",
              "last_name": "Scott",
              "is_admin": true,
              "is_available": false,
              "is_blocked": false,
              "type": "user",
              "custom_fields": {}
            }
          }
        },
        {
          "label": "Recipients",
          "value": "recipients",
          "schema": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Jane Smith"
                },
                "handle": {
                  "type": "string",
                  "example": "jane@example.com"
                },
                "role": {
                  "type": "string",
                  "example": "to"
                }
              }
            },
            "example": [
              {
                "name": "Jane Smith",
                "handle": "jane@example.com",
                "role": "to"
              }
            ]
          }
        },
        {
          "label": "Attachments",
          "value": "attachments",
          "schema": {
            "type": "array",
            "example": [
              {
                "id": "fil_3q8a7mby",
                "filename": "quote-2024-06.pdf",
                "url": "https://api2.frontapp.com/download/fil_3q8a7mby",
                "content_type": "application/pdf",
                "size": 48213,
                "metadata": {
                  "is_inline": false
                }
              }
            ]
          }
        },
        {
          "label": "Signature",
          "value": "signature",
          "schema": {
            "type": "object",
            "example": {
              "_links": {
                "self": "https://api2.frontapp.com/signatures/sig_6rrv2",
                "related": {
                  "owner": "https://api2.frontapp.com/teams/tim_k30"
                }
              },
              "id": "sig_6rrv2",
              "name": "Support team signature",
              "body": "<div>{{user.name}}<br />Customer Support, Example Corp</div>",
              "sender_info": null,
              "is_visible_for_all_teammate_channels": true,
              "is_default": false,
              "is_private": false,
              "channel_ids": null
            }
          }
        },
        {
          "label": "Conversation Reference",
          "value": "conversation_reference",
          "schema": {
            "type": [
              "string",
              "null"
            ],
            "example": null
          }
        },
        {
          "label": "Status",
          "value": "status",
          "schema": {
            "type": "string",
            "example": "accepted"
          }
        },
        {
          "label": "Links",
          "value": "_links",
          "schema": {
            "type": "object",
            "properties": {
              "self": {
                "type": "string",
                "example": "https://api2.frontapp.com/messages/msg_1q15qmtq"
              },
              "related": {
                "type": "object"
              }
            },
            "example": {
              "self": "https://api2.frontapp.com/messages/msg_1q15qmtq",
              "related": {
                "conversation": "https://api2.frontapp.com/conversations/cnv_yo1kg5q",
                "message_replied_to": null,
                "message_seen": "https://api2.frontapp.com/messages/msg_1q15qmtq/seen"
              }
            }
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
