{
// Required
id: Id;
// Optional
meeting_id: Id;
}For each PayloadElement there can be multiple ActionData-items and there could be several PayloadElements.
Therefore, the action results usually with success = True, except there is an unexpected error. You have to check the individual results in the 2 dimensional (payloadElement/ActionData) array for a send = true or false. In case of false you'll get an error message, too.
If possible, all result items contain the recipient_user_id and recipient_meeting_id.
For details of results have a look at the tests here.
It must be checked, that a user (given by the key id) belongs to a meeting (given by the key meeting_id). If not, send is set to False and an explicit message is included. Also, the user must have user/email set. If it is empty or invalid, there will be an appropiate message.
Check the meeting/users_email_sender (if a meeting is given by meeting_id) or the organization/users_email_sender (senders name): If one of the characters [, ] or \ is in the string, you'll get an error message in the result. (See here for OS3-Code)
Send an email to a user with
- The
toheader set to the users email address - The
fromheader: if given, usemeeting/users_email_senderas senders name together withDEFAULT_FROM_EMAILread from the environment variables as eMail address.. - The
Reply-Toheader:meeting/users_email_replytoif it is not empty subjectandbody: see below.
This is the OS3 code. And this one. Please have a look at it due to excessive error handling.
If the email could be send successfully you get a response for the corresponding ActionData-item with {"send": true} otherwise with {"send": false}.
Use meeting/users_email_subject (if a meeting is given by meeting_id); otherwise use organization/users_email_subject. The string can have placeholders like {username} in it. Provide
event_nameasmeeting/name(if a meeting is given, otherwiseorganization/name) andusernameasuser/usernamenameas the users short nametitleasuser/titlegiven_nameasuser/first_namesurnameasuser/last_namegroupsas a listing of the names of the users groups in the meetingstructure_levelsas a listing of the names of the users structure_levels in the meeting to be replaced in the template (see here)
It does an equal string formatting as for the subject. Use meeting/users_email_body (if a meeting is given by meeting_id, otherwise it's organization/users_email_body) and provide
event_nameasmeeting/name(if a meeting is given, otherwiseorganization/name)nameas the users short nameurlasmeeting/users_pdf_url(this can only be used, if a meeting is given; otherwise it's theorganization/url)usernameasuser/usernamepasswordasuser/default_passwordtitleasuser/titlefirst_nameasuser/first_namelast_nameasuser/last_namegroupsas a listing of the names of the users groups in the meeting.structure_levelsas a listing of the names of the users structure_levels.
Sending email is no longer refused, the wrong keyword will be injected instead.
The requesting user needs the permission user.can_update if a meeting_id is given or, if not, the permission OML can_manage_users.