sym.sdk.integrations.sym.get_or_create_users_by_emails¶
- sym.sdk.integrations.sym.get_or_create_users_by_emails(emails: List[str], raise_on_error: bool = False) List[sym.sdk.user.User] ¶
For each of the given list of email addresses, retrieve the corresponding Sym
User
if one exists, or create a new one otherwise.If
raise_on_error
isTrue
, then any “routine” errors that occur while processing the list of emails (for example, an invalid email was specified or a user could not be found and failed to be created) will be raised as an exception. Otherwise, the errors will be logged as warnings and the corresponding user will be omitted from the output. The returned list of users will never containNone
s.Regardless of the value of
raise_on_error
, serious errors (such as a communication failure within the Sym platform or malformed input) will always be raised as exceptions.- Parameters
emails – A list of email addresses of the users to retrieve or create. Must not contain any
None
values.raise_on_error – Whether to raise an exception if an error occurs while processing the list of emails. If
False
, errors will be logged as warnings and the corresponding user will be omitted from the output. Defaults toFalse
.
- Returns
A list of Sym
User
s corresponding to the given email addresses.- Raises
SymIntegrationError – If
raise_on_error
isTrue
and any errors occur while processing the list of emails, or if any other error occurs.