Send a message to employees
Command Description
Send text messages, pictures, files, and other messages to designated employees
Command Prototype
DingTalk.SendToUser(DingTalk_obj, user_id, message)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
DingTalk_obj | True | expression | DingTalkObject | The DingTalk object created using the DingTalk. Create command |
user_id | True | string | "" | Send work notifications to designated employees; It can be one employee or multiple employees. If it is one employee, please specify the employee ID here. If it is multiple employees, please use an array to represent it. Each element in the array is an employee ID, with a maximum of 100 elements |
message | True | string | "" | Specify the message to be sent, which can be a string representing the sending of a regular message, with a maximum length of 2048 bytes; It can also be images, files, and other messages created previously using commands such as DingTalk. CreateImageMessage and DingTalk. CreateFileMessage |
Return result
Run instance
/********************************* Send Message to Employee **************************************
Command Prototype:
DingTalk.SendToUser(DingTalk_obj, user_id, message)
Input Parameters:
DingTalk_obj -- DingTalk object. Note: DingTalk object created using the DingTalk.Create command.
user_id -- Employee ID. Note: Send work notifications to specified employee(s). Can be a single employee or multiple employees. If a single employee, specify the employee ID here. If multiple employees, represent as an array where each element is an employee ID, with a maximum of 100 elements.
message -- Message to send. Note: Specify the message to be sent. Can be a string representing regular message (maximum 2048 bytes), or can be image/file messages previously created using DingTalk.CreateImageMessage, DingTalk.CreateFileMessage commands.
Output Parameters:
None
Important Notes:
None
********************************************************************************/
DingTalk.SendToUser(DingTalkObject, "", "")