class InvitedUserMessageInfo
A data class that configures invitation messages for invited users, including CC recipients, custom message body, and language preferences.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/invitations/message_info.py
6 - 23
simple
Purpose
InvitedUserMessageInfo is used to customize invitation messages sent to users in Microsoft 365/Office 365 environments. It allows specifying additional recipients (CC), custom message content, and the language for the invitation. This class inherits from ClientValue, making it suitable for serialization and transmission in API requests to Microsoft Graph or similar services.
Source Code
class InvitedUserMessageInfo(ClientValue):
"""The invitedUserMessageInfo object allows you to configure the invitation message."""
def __init__(
self, cc_recipients=None, customized_message_body=None, message_language=None
):
"""
:param list[Recipient] cc_recipients: Additional recipients the invitation message should be sent to.
Currently only 1 additional recipient is supported.
:param str customized_message_body: Customized message body you want to send if you don't want the default
message.
:param str message_language: The language you want to send the default message in. If the customizedMessageBody
is specified, this property is ignored, and the message is sent using the customizedMessageBody.
The language format should be in ISO 639. The default is en-US.
"""
self.ccRecipients = ClientValueCollection(Recipient, cc_recipients)
self.customizedMessageBody = customized_message_body
self.messageLanguage = message_language
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
cc_recipients: A list of Recipient objects representing additional recipients who should receive the invitation message. Currently limited to 1 additional recipient. Can be None if no CC recipients are needed. Each recipient should be a valid Recipient object from the office365.outlook.mail.recipient module.
customized_message_body: A string containing a custom message body for the invitation. If provided, this overrides the default invitation message. Can be None to use the default message. Should contain the complete message text you want to send.
message_language: A string specifying the language code for the default invitation message in ISO 639 format (e.g., 'en-US', 'fr-FR', 'de-DE'). This parameter is ignored if customized_message_body is specified. Defaults to 'en-US' if not provided. Can be None to use the default language.
Return Value
Instantiation returns an InvitedUserMessageInfo object with three attributes: ccRecipients (a ClientValueCollection of Recipient objects), customizedMessageBody (string or None), and messageLanguage (string or None). This object can be serialized and used in API calls to configure invitation messages.
Class Interface
Methods
__init__(self, cc_recipients=None, customized_message_body=None, message_language=None)
Purpose: Initializes an InvitedUserMessageInfo instance with optional invitation message configuration
Parameters:
cc_recipients: Optional list of Recipient objects for CC recipients (max 1)customized_message_body: Optional string for custom invitation message bodymessage_language: Optional ISO 639 language code string for default message language
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
ccRecipients |
ClientValueCollection[Recipient] | A collection of Recipient objects representing additional recipients who should receive the invitation message as CC. Currently limited to 1 recipient. | instance |
customizedMessageBody |
str or None | The custom message body text for the invitation. If set, this overrides the default message and the messageLanguage setting is ignored. | instance |
messageLanguage |
str or None | The ISO 639 language code for the default invitation message (e.g., 'en-US'). This is ignored if customizedMessageBody is specified. | instance |
Dependencies
office365.outlook.mail.recipientoffice365.runtime.client_valueoffice365.runtime.client_value_collection
Required Imports
from office365.outlook.mail.recipient import Recipient
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
Usage Example
from office365.outlook.mail.recipient import Recipient
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
# Create a simple invitation with default message in English
invite_info = InvitedUserMessageInfo()
# Create an invitation with a custom message
custom_invite = InvitedUserMessageInfo(
customized_message_body="Welcome to our team! Please join us."
)
# Create an invitation with CC recipient and French language
cc_recipient = Recipient()
cc_recipient.emailAddress = {"address": "manager@example.com", "name": "Manager"}
invite_with_cc = InvitedUserMessageInfo(
cc_recipients=[cc_recipient],
message_language="fr-FR"
)
# Access attributes
print(invite_with_cc.messageLanguage) # Output: fr-FR
print(invite_with_cc.ccRecipients) # ClientValueCollection of Recipients
Best Practices
- Only one CC recipient is currently supported, so ensure cc_recipients list contains at most one Recipient object
- When providing customized_message_body, the message_language parameter will be ignored, so only set one or the other
- Use ISO 639 language codes for message_language (e.g., 'en-US', 'fr-FR', 'de-DE')
- This class is typically used as a parameter in user invitation API calls, not as a standalone object
- The class inherits from ClientValue, which means it's designed for serialization to JSON for API requests
- All parameters are optional during instantiation, allowing flexible configuration based on needs
- Ensure Recipient objects are properly constructed before passing them to cc_recipients
- The ccRecipients attribute is automatically wrapped in a ClientValueCollection for proper serialization
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class InvitationParticipantInfo 68.8% similar
-
class Invitation 62.0% similar
-
class MeetingInfo 59.2% similar
-
class MeetingParticipantInfo 58.6% similar
-
class SPInvitationCreationResult 58.3% similar