🔍 Code Extractor

class AutomaticRepliesSetting

Maturity: 52

A configuration class for automatic email reply settings that defines how a user's mailbox responds to incoming emails when the user is unavailable.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/automatic_replies_setting.py
Lines:
4 - 27
Complexity:
simple

Purpose

This class represents the configuration settings for automatic email replies (out-of-office messages) in Microsoft Office 365. It allows configuration of different reply messages for internal and external audiences, and controls which external recipients receive automatic replies. The class inherits from ClientValue, making it suitable for serialization and transmission to Office 365 services via API calls.

Source Code

class AutomaticRepliesSetting(ClientValue):
    """
    Configuration settings to automatically notify the sender of an incoming email with a message from the signed-in
    user. For example, an automatic reply to notify that the signed-in user is unavailable to respond to emails.
    """

    def __init__(
        self,
        external_audience=None,
        external_reply_message=None,
        internal_reply_message=None,
    ):
        """
        :param str external_audience: The set of audience external to the signed-in user's organization who will
           receive the ExternalReplyMessage, if Status is AlwaysEnabled or Scheduled.
           The possible values are: none, contactsOnly, all.
        :param str external_reply_message: The automatic reply to send to the specified external audience, if Status
           is AlwaysEnabled or Scheduled.
        :param str internal_reply_message: The automatic reply to send to the audience internal
            to the signed-in user's organization, if Status is AlwaysEnabled or Scheduled.
        """
        self.externalAudience = external_audience
        self.externalReplyMessage = external_reply_message
        self.internalReplyMessage = internal_reply_message

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

external_audience: Defines which external recipients (outside the user's organization) will receive automatic replies. Valid values are: 'none' (no external recipients), 'contactsOnly' (only contacts in the user's address book), or 'all' (all external senders). This setting only applies when automatic replies are enabled.

external_reply_message: The message content that will be sent as an automatic reply to external senders (those outside the user's organization). This is a string containing the reply text, which can include HTML formatting. Only used when Status is AlwaysEnabled or Scheduled.

internal_reply_message: The message content that will be sent as an automatic reply to internal senders (those within the user's organization). This is a string containing the reply text, which can include HTML formatting. Only used when Status is AlwaysEnabled or Scheduled.

Return Value

Instantiation returns an AutomaticRepliesSetting object that encapsulates automatic reply configuration. The object contains three attributes (externalAudience, externalReplyMessage, internalReplyMessage) that can be serialized for API communication with Office 365 services.

Class Interface

Methods

__init__(self, external_audience=None, external_reply_message=None, internal_reply_message=None)

Purpose: Initializes an AutomaticRepliesSetting instance with configuration for automatic email replies

Parameters:

  • external_audience: String specifying which external recipients receive replies: 'none', 'contactsOnly', or 'all'. Defaults to None.
  • external_reply_message: String containing the automatic reply message for external senders. Defaults to None.
  • internal_reply_message: String containing the automatic reply message for internal senders. Defaults to None.

Returns: None (constructor)

Attributes

Name Type Description Scope
externalAudience str or None Stores the external audience setting that determines which external recipients receive automatic replies. Valid values: 'none', 'contactsOnly', 'all'. instance
externalReplyMessage str or None Stores the message content that will be sent to external recipients as an automatic reply. Can contain plain text or HTML. instance
internalReplyMessage str or None Stores the message content that will be sent to internal recipients (within the organization) as an automatic reply. Can contain plain text or HTML. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue

Usage Example

from office365.runtime.client_value import ClientValue
from office365.outlook.mail.automatic_replies_setting import AutomaticRepliesSetting

# Create automatic reply settings for vacation
auto_reply = AutomaticRepliesSetting(
    external_audience='contactsOnly',
    external_reply_message='I am currently out of office and will respond when I return.',
    internal_reply_message='I am on vacation until next Monday. For urgent matters, contact my manager.'
)

# Access the settings
print(auto_reply.externalAudience)  # 'contactsOnly'
print(auto_reply.internalReplyMessage)  # Internal message text

# Typically used with Office 365 mailbox settings API
# mailbox.automatic_replies_setting = auto_reply
# mailbox.update().execute_query()

Best Practices

  • Always validate external_audience parameter to be one of: 'none', 'contactsOnly', or 'all' before setting
  • Ensure reply messages are properly formatted and contain appropriate contact information for urgent matters
  • Consider HTML formatting in reply messages for better presentation
  • This class is typically used in conjunction with Office 365 mailbox settings API and should not be instantiated in isolation
  • The Status field (AlwaysEnabled/Scheduled) is managed separately and determines when these settings take effect
  • Remember that external_reply_message and internal_reply_message can be different to provide appropriate context to each audience
  • Set external_audience to 'none' if you only want internal automatic replies
  • This is a data transfer object (DTO) that inherits from ClientValue for serialization purposes

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class Recipient 58.9% similar

    A class representing information about a user in the sending or receiving end of an event, message or group post in Microsoft Office 365 Outlook.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/recipient.py
  • class Configuration 55.1% similar

    A configuration class that specifies additional application IDs allowed to manage and index content in an externalConnection within the Office365 environment.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/search/external/configuration.py
  • class AttendeeAvailability 54.7% similar

    A data class representing the availability status of an attendee for a calendar event in Microsoft Outlook.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/calendar/attendees/availability.py
  • class MessageRule 54.3% similar

    A class representing an Outlook message rule that defines conditions, actions, and exceptions for automatically processing incoming messages in a user's Inbox.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/messages/rules/rule.py
  • class SmtpServer 53.8% similar

    A data class representing an SMTP server configuration with a value and read-only flag, inheriting from ClientValue.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/smtp_server.py
← Back to Browse