def fetch_mails()

in ees_microsoft_outlook/sync_microsoft_outlook.py [0:0]


    def fetch_mails(self, ids_list, users_account, mail_object, start_time, end_time):
        """This method is used to fetch mails from Microsoft Outlook
        :ids_list: List of ids of documents
        :param users_account: List of user accounts
        :param mail_object: Object of mails
        :param start_time: Start time for fetching the mails
        :param end_time: End time for fetching the mails
        """
        self.logger.info("Fetching Mails from Microsoft Outlook")
        try:
            documents = mail_object.get_mails(
                ids_list, users_account, start_time, end_time
            )
        except Exception as exception:
            self.logger.exception(f"Error while fetching Mails. Error: {exception}")
        self.logger.info("Successfully fetched Mails from Microsoft Outlook")
        self.queue.append_to_queue(constant.MAILS_OBJECT.lower(), documents)