Print

SendMessage

CAUTION! This function is deprecated. It is recommended to use the SendMessageEx() function instead.

This function sends an automated email 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

SendMessage("recipient", "subject", "body");
SendMessage("recipient", "subject", "body", "isHTML");
SendMessage("recipient", "subject", "body", "isHTML", "sender");
SendMessage("recipient", "subject", "body", "isHTML", "sender", "replyTo");
SendMessage("recipient", "subject", "body", "isHTML", "sender", "replyTo", "addCaseIdToSubject");

Function arguments

  • recipient – (String) Raw email address or AMODIT user login (if exists).
  • subject – (String) The subject of the message
  • body – (String) Actual message body (conent)
  • isHTML – (Boolean) [Optional] Indicate if message body contains HTML so it gets proccessed properly (default = false)
  • sender – (String) [Optional] Custom sender address (’from’ field)
  • replyTo – (String) [Optional] Custom replay to address (’replyto’ 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.

SendMessage("r.simmons", "Case modified", "The case was modified");

Example 2: This will send mail message to 'externalUser@company.com’

SendMessage("externalUser@company.com", "Your case", "Your case is being proccessed");

Example 3: This will send mail message based on variales content.

myManager = GetManager(CurrentUser());
caseTitle = [CaseTitle];
subject = "Case" + caseTitle + "was modified.";body = "Case was modified!".
SendMessage(myManager, subject, body);

Example 4: This will send mail message and set 'MyMailAddress@mycompany.com’ as sender’s address.

SendMessage("external@company.com", "Subject", "Body", true, "MyMailAddress@mycompany.com");

Example 5: This will send mail message and set 'MyMailAddress@mycompany.com’ as sender’s address and mark that message body contains HTML so it will get proccessed properly.

SendMessage("external@company.com", "Subject", "Body with HTML", true, "MyMailAddress@mycompany.com");

Example 6: This will mark that message body contains HTML so it will get proccessed properly.

SendMessage("external@company.com", "Subject", "Body with HTML", true);

Example 7: This will send mail message without caseid in subject and mail headers.

SendMessage("external@company.com", "Subject", "Body with HTML", true, "","",false);
Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?