Void setValue(String colName, String value)
Sets a named field to the given value. Look up names in the reference section down below, or check out the class reference.Both parameters are strings! Remember to use quotes even for IDs.You must call
save() after setting all applicable values to actually create or update the message.Frequently used values
For a complete list of fields, see the database reference.
Void setAttachments(Vector ids)
Connects 1 or more attachments to the message. Attachments are identified by their ID.You must call
save() before calling setAttachments()!Void addHeader(String type, String value)
Adds a display header to the message. Not to be confused with email header! Display headers are shown at the View request page when listing messages. Commonly used types are To, Cc, Bcc, and SMS. The corresponding value would then be the recipients as a comma-separated list.Integer save()
Saves a new or updated message and returns its ID.Integer save(String log)
A variant ofsave() that also adds a message to the ticket log.
Integer save(String log, Bool noNewInfo)
A variant ofsave() with a setting for controlling processing:
noNewInfo: if false, set the read status on ticket to yellow (if currently green)
Using reply templates
You can save time by using a reply template as your basis.Void toParser(Parser parser)
Passes relevant data from the message to the parser.- message.id
- message.slevel, message.slevelInteger (as text in the active user’s language and as number)
- message.createdAt, message.createdAtRaw (formats DD. MMM YYYY, kl. hh:mm and YYYY-MM-DD hh:mm:ss)
- message.author
- message.header
- message.body, message.bodyPlain, message.bodyHtml
- message.messageCategory (Message: 0, Bounce: 1, OutboxFailed: 2)
- message.mailSorter (mail filter applied to incoming message)
- message.x_myextrafield (extrafield value)