> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ej_message table

> This table contains the messages listed under tickets.

## ej\_message Table (258)

This table contains the messages listed under tickets.

## Fields

| Name                          | Description                                                                                                                                                                | Type                                                            | Nullable |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | :------: |
| id                            | The primary key (auto-incremented)                                                                                                                                         | PK                                                              |    No    |
| ticket\_id                    | The ticket this message is a child of.                                                                                                                                     | FK [ticket](./ticket.mdx)                                       |    No    |
| search\_title                 | A copy of the title of the ticket, for search optimisation and simpler reporting.                                                                                          | String(255)                                                     |    No    |
| created\_at                   | When the message was posted.                                                                                                                                               | DateTime                                                        |    Yes   |
| created\_by                   | The id of the user who posted the message. The value 1 (system user) for externally posted messages.                                                                       | FK [ejuser](./ejuser.mdx)                                       |    No    |
| type                          | The type of the message (plaintext/html).                                                                                                                                  | Enum [TicketMessageType](./enums/ticketmessagetype.mdx)         |    Yes   |
| message\_category             | Defines what kind of message this is.                                                                                                                                      | Enum [TicketMessageCategory](./enums/ticketmessagecategory.mdx) |    No    |
| author                        | A string representing the author of the message. Could be a user\&apos;s name, or a persons email address.                                                                 | String(255)                                                     |    Yes   |
| slevel                        | The securitylevel of the message.                                                                                                                                          | Enum [TicketSecurityLevel](./enums/ticketsecuritylevel.mdx)     |    Yes   |
| message\_id                   | The Message-Id header value from the email. Used for threading, i.e. connecting messages to existing tickets.                                                              | String(850)                                                     |    No    |
| time\_spent                   | The time spent (minutes) for this message.                                                                                                                                 | Int                                                             |    Yes   |
| time\_charge                  | The amount of time (minutes) which should be invoiced for this message.                                                                                                    | Int                                                             |    Yes   |
| body                          | The textbody for the message.                                                                                                                                              | Clob                                                            |    Yes   |
| html\_body                    | The html body for the message (if any).                                                                                                                                    | Clob                                                            |    Yes   |
| email\_header                 | The email header is saved in this field as raw text                                                                                                                        | Clob                                                            |    Yes   |
| debug\_info                   | The debug info for the message.                                                                                                                                            | Clob                                                            |    Yes   |
| mail\_sorter                  | The name of the mail sorter used when the email was imported. Note: We must use name instead of id since the id\&apos;s change every time one changes the mail sorter. :-0 | String(255)                                                     |    Yes   |
| customer\_id                  | If the message was created by email or from the customer center, this field will point to that customer. -1 if the message was created by an user                          | FK [person](./person.mdx)                                       |    No    |
| body\_attachment              | If the body is too long for the database, it\&apos;s stored in this attachment instead.                                                                                    | FK [attachment](./attachment.mdx)                               |    No    |
| html\_body\_attachment        | If the htmlbody is too long for the database, it\&apos;s stored in this attachment instead.                                                                                | FK [attachment](./attachment.mdx)                               |    No    |
| html\_body\_inline\_converted | True if the html\_body has converted inline image links.                                                                                                                   | Bool                                                            |    No    |
| inbox                         | The id of the inbox entry which created this message. Note: inbox entries are regularily deleted.                                                                          | FK [inbox](./inbox.mdx)                                         |    Yes   |
| important                     | If this message is important or not.                                                                                                                                       | Bool                                                            |    Yes   |
| language                      | The language this message is in, based on some kind of analysis                                                                                                            | String(10)                                                      |    Yes   |
| sentiment                     | Sentiment index, 100 = completely happy; -100 = suicidally unhappy; 0 = no idea                                                                                            | Int                                                             |    Yes   |
| sentimentConfidence           | Confidence of sentiment index, 0 = no idea, 100 = completely sure                                                                                                          | Int                                                             |    Yes   |
| changed\_at                   | When the message was changed.                                                                                                                                              | DateTime                                                        |    Yes   |
| changed\_by                   | The id of the user who changed the message.                                                                                                                                | FK [ejuser](./ejuser.mdx)                                       |    Yes   |
| badge                         | Badge to explicitly determine how a message was generated                                                                                                                  | Enum [BadgeType](./enums/badgetype.mdx)                         |    No    |

<img src="https://mintcdn.com/superofficeas/i6M2qZmvMNH7UTeu/media/loc/en/database/tables/ej_message.png?fit=max&auto=format&n=i6M2qZmvMNH7UTeu&q=85&s=195cae72a484c9371935389f866d98f5" alt="ej_message table relationship diagram" width="962" height="872" data-path="media/loc/en/database/tables/ej_message.png" />

## Indexes

| Fields                          | Types                   | Description |
| ------------------------------- | ----------------------- | ----------- |
| ticket\_id                      | FK                      | Index       |
| created\_by                     | FK                      | Index       |
| message\_id                     | String(850)             | Index       |
| customer\_id                    | FK                      | Index       |
| body\_attachment                | FK                      | Index       |
| html\_body\_attachment          | FK                      | Index       |
| search\_title, body, html\_body | String(255), Clob, Clob | Full text   |
| created\_at                     | DateTime                | Index       |

## Relationships

| Table                                      | Description                                                                                                                                                   |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [attachment](./attachment)                 | This table contains metadata for attachments. The actual attachments are stored directly on disk, with filenames based on the the primary key for this table. |
| [ejuser](./ejuser)                         | This table contains entries for the users of the system.                                                                                                      |
| [inbox](./inbox)                           | Info and status for safe email import                                                                                                                         |
| [invoice\_entry](./invoice-entry)          | This table contain all invoices, connected to a message                                                                                                       |
| [message\_customers](./message-customers)  | This table contains all cutomers who are involved in a message                                                                                                |
| [message\_header](./message-header)        | This table contains small pieces of information which is listed over the body for each message.                                                               |
| [outbox](./outbox)                         | Outgoing emails with sending status and other info                                                                                                            |
| [person](./person)                         | Persons                                                                                                                                                       |
| [sms](./sms)                               | This table will hold outgoing sms messages when transmitted with WebServices                                                                                  |
| [ticket](./ticket)                         | This table contains the tickets (requests) of the system. Its purpose should be evident.                                                                      |
| [ticket\_attachment](./ticket-attachment)  | This table connects an attachment to a message. It references the entry in the attachment table, and the message.                                             |
| [ticket\_log\_action](./ticket-log-action) | This table contains actions for the tickets.                                                                                                                  |
| [ticket\_log\_change](./ticket-log-change) | This table contains log entries for the tickets.                                                                                                              |

## Replication Flags

* None

## Security Flags

* Sentry controls access to items in this table using user's Role and data rights matrix on the table's parent.


## Related topics

- [What's new in version 10.2.4.796](/release-notes/database/changes-10.2.4.md)
- [What's new in version 10.2.6.1248](/release-notes/database/changes-10.2.6.md)
- [What's new in version 10.2.5.1175](/release-notes/database/changes-10.2.5.md)
- [What's new in version 10.2.1.1517](/release-notes/database/changes-10.2.1.md)
- [What's new in version 10.2.2.707](/release-notes/database/changes-10.2.2.md)
- [What's new in version 10.2.3.544](/release-notes/database/changes-10.2.3.md)
