ℹ️ The Auron SMS Server is now Auron Omni. Learn more here.

How can we help?

Add new message type (WISe only)


In Auron WISe, you can add custom message types. A message type has a set of properties that is distinct from other message types. Messages are the central data structure in Auron WISe. Messages are sent or received by channels and processed by triggers.

While Auron Omni comes with a fixed set of message types, you can add your own custom message types to Auron WISe.

Please note that adding a new message type requires technical knowledge. If you are unsure how to do this, feel free to contact us.

For the remainder of this article we assume that you are able and authorized to connect to the Auron WISe server and database.

Message_Types table

Add a new message type to Auron WISe by adding a new record to the Message_Types table. You also need to add a data table to the WISe message database and the archive database. Here is a relation diagram:

Message_Types table in a relation diagram

Message_Types table in a relation diagram

These are the fields in the Message_Types table:

Field name Description
ID Primary key and identifier. Must be an uppercase string without spaces, no longer than 32 characters. For example: CUSTOM_MESSAGE_TYPE.
DataTable Name of the table that holds message type specific data. The message type data table links to the message table. The structure of this table defines the fields for this message type.

This table does not exist yet and must be created manually. Learn more below.

Description The display name.
InfoUrl (Optional) Link to a URL with more information about this message type.
LongDescription The full description.
EditorPath (Optional) Path to a specialized editor for message properties. Leave empty to use the default editor.

When creating an editor in .NET you can use plugin.dll. This assembly is included with WISe and exposes CMessageForm to help build message forms in the same style as standard message types.

The WISe Manager starts the editor with these arguments:

/ID
/REPLY (reply to message)
/FORWARD (forward message)
/EDIT (edit message)

Without arguments a new message is created.

ProgramId (Optional) Reference to a custom COM object that wraps this message for use in triggers or scripts.

To create a COM wrapper, your object must implement:
SetMessageObject (accepts AxMmServer.Message)
GetMessageObject (returns AxMmServer.Message)

HasAttachments 1 if the message supports attachments. 0 if not. Setting this to 0 improves performance slightly.
SupportReply 1 if replies make sense for this message type. 0 if not.
SupportForward 1 if forwarding is supported. 0 if not.
Icon (Optional) Binary 48×48 PNG icon for the message type.

You can generate it using:

SELECT * FROM OPENROWSET(BULK N’C:\dir\filename.png’, SINGLE_BLOB) rs

DisplayOrder Order in the “new message” dialog. Lower values appear first.

Data table

The data table stores custom message fields and defines the structure of the message type. Only one field is required:

MessageID INT

The following SQL data types are supported:

  • DATETIMEOFFSET, DATETIME: date values. Prefer DATETIMEOFFSET
  • INT: whole numbers
  • FLOAT: decimal numbers
  • BIT: boolean values
  • NVARCHAR, VARCHAR: strings. Prefer NVARCHAR

Arch Data Table

Your message data table also needs a corresponding table in the archive database. The name must be prefixed with Arch. For example, Messages_CustomMessage becomes ArchMessages_CustomMessage.

If you use a separate archive database, you must create this table there. If both databases are the same, you still need to create the table but it can live in the same database.

The archive table must have the same structure as the data table.

Insert View (Optional)

Insert views are an optional optimization that allows inserting into both the message table and your data table in a single operation.

The insert view joins the Messages table with your custom data table. Since inserts into such a view are not directly supported, you must use an insert trigger.

You can create this trigger automatically by calling:

CreateInsertTriggerForMessageView

on the view.

Example

Find an example for setting up a custom message type in the Auron Software GitHub.

To add a custom message type, run:

INSERT INTO Message_Types(ID, Description, LongDescription, InfoUrl, DataTable,
 EditorPath, ProgramId, HasAttachments, SupportReply, SupportForward, Icon, DisplayOrder) 
VALUES (
  'CUSTOM_MESSAGE_TYPE',
  'Custom Message Type',
  '', '',
  'Messages_CustomMessage',
  '"MsgCustomMessage.exe"',
  '',
  1, 1, 1,
  NULL, 1)

Next create the data table and archive data table. In this example archiving happens in the same database:

CREATE TABLE Messages_CustomMessage
(
    MessageID INT NOT NULL,
    TestField NVARCHAR(255),
    -- Other custom fields
    CONSTRAINT pk_Messages_CustomMessage_MessageID PRIMARY KEY (MessageID)
)

CREATE TABLE ArchMessages_CustomMessage
(
    MessageID INT NOT NULL,
    TestField NVARCHAR(255),
    -- Other custom fields
    CONSTRAINT pk_ArchMessages_CustomMessage_MessageID PRIMARY KEY (MessageID)
)

Finally, set up the insert view:

CREATE VIEW InsertCustomMessage AS 
  SELECT * FROM Messages M 
    INNER JOIN Messages_CustomMessage D ON M.ID = D.MessageID

EXECUTE CreateInsertTriggerForMessageView @sViewName='InsertCustomMessage', 
  @sDataTable='Messages_CustomMessage', 
  @sTypeID='CUSTOM_MESSAGE_TYPE'

Reset service and restart manager

After adding a new message type, restart both the Auron WISe service and the manager to activate it.

You can now create and process messages of your custom message type.