Send a message to employees in the department
Command Description
Send text messages, pictures, files, and other messages to each employee in the designated department
Command Prototype
WxWork.SendToDepartment(wxwork_obj, department, message, is_safe)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
wxwork_obj | True | expression | WxWorkObject | Enterprise WeChat object created using the WxWork. Create command |
department | True | number | one | Send work notifications to every employee in the designated department; It can be one department or multiple departments. If it is one department, please specify the department ID here. If it is multiple departments, please use an array to represent it. Each element in the array is a department ID, with a maximum of 100 elements |
message | True | string | "" | Specify the message to be sent, which can be a string representing the text message to be sent, with a maximum length of 2048 bytes; It can also be images, files, and other messages created previously using commands such as WxWork.CreatImageMessage and WxWork.CreatFileMessage |
is_safe | True | boolean | False | Specify whether to send this message in confidential mode. If yes, the message cannot be shared and a watermark will be added to the message to avoid taking screenshots |
Return result
Run instance
/********************************* Send Message to Employees in Department **********************************
Command Prototype:
WxWork.SendToDepartment(wxwork_obj, department, message, is_safe)
Input Parameters:
wxwork_obj -- WeChat Work object. Note: WeChat Work object created using the WxWork.Create command.
department -- Department ID. Note: Send work notifications to each employee in the specified department(s). Can be a single department or multiple departments. If a single department, specify the department ID here. If multiple departments, represent as an array where each element is a department ID, with a maximum of 100 elements.
message -- Message to send. Note: Specify the message to be sent. Can be a string representing text message (maximum 2048 bytes), or can be image/file messages previously created using WxWork.CreateImageMessage, WxWork.CreateFileMessage commands.
is_safe -- Confidential mode. Note: Specify whether to send this message in confidential mode. If yes, the message cannot be shared and will have a watermark added to prevent screenshots.
Output Parameters:
None
Important Notes:
None
********************************************************************************/
WxWork.SendToDepartment(WxWorkObject, 1, "", False)