SendMessageWithAttachments
CAUTION! This function is deprecated. It is recommended to use the SendMessageEx() function instead.
This function sends an email with attachments to the specified system user or raw email address.
Note that sending an email this way may add a comment to the case, if the „AddCommentFromSendMessage” box is checked in the system settings.
Syntax
SendMessageWithAttachments("attachment formula", "receivers", "subject", "body");
SendMessageWithAttachments("attachment formula", "receivers", "subject", "body", "AMODIT message format", "sender");
SendMessageWithAttachments("attachment formula", "receivers", "subject", "body", "AMODIT message format", "sender","addCaseIdToSubject");
Function arguments
- attachment formula – (String) formula to get attachments. * all – send all attachments * fields name – send attachment from form fields. Fields must by file type. Can be passed few fields splitted by ’;’ * template name – send attachments that match template * file name – send attachment which match pattern. Star '*’ in pattern mean any string
- receivers – (String) Raw email address or AMODIT username
- subject – (String) The subject of the message
- body – (String) Actual message body (content)
- AMODIT message format – (Boolean) [Optional] Indicate if message use AMODIT headers. (default = false)
- sender – (String) [Optional] Custom sender address (’from’ field)
- addCaseIdToSubject – (Boolean) [Optional] Add caseid to mail subject and headers (default true), if false then response to this mail will not be attach as comment to current case
Return value
This function returns Boolean. Returns true if message was sent successfully, false otherwise.
Examples
Example 1: This will send mail message to r.simmons with all case attachments.
SendMessageWithAttachments("all", "r.simmons", "Attachments", "Here are case attachments");
Example 2: This will send mail message to r.simmons with all case attachments. It use AMODIT default format and set 'MyMailAddress@mycompany.com
SendMessageWithAttachments("all", "r.simmons", "Attachments", "Here are case attachments", "true", "MyMailAddress@mycompany.com");
Example 3: This will send mail message to r.simmons. firstly it will try to get attachment from case field with name „Dokument”. If field do not exist on case it will try get attachment which use template named „Dokument”. If it is not found template with that name, it will try find attachments with name „Dokument”.
SendMessageWithAttachments("Dokument", "r.simmons", "Attachments", "Here are case attachments");
Example 4: This will send mail message to r.simmons with attachments which starts with „FVS” and ends with „.pdf”.
SendMessageWithAttachments("FVS*.pdf", "r.simmons", "Attachments", "Here are case attachments");
Example 5: This will send mail message to r.simmons with all case attachments. Messsage will not be formated like standard AMODIT message and will not contains caseid in subject.
SendMessageWithAttachments("all", "r.simmons", "Attachments", "Here are case attachments",false,"",false);