email_keyword_matcher/__init__.py
def _get_response(
            self,
            from_email: str,
            subject: str,
    ) -> email.message.EmailMessage:
        """Return the response email message."""
        matches = self.get_response(from_email, subject)
        if not matches:
            raise RuntimeError('No messages found')

        return_code, data = self._imap.fetch(matches[0], '(RFC822)')
        if return_code != 'OK':
            raise RuntimeError(
                f"Got return code '{return_code}' from fetching")

        return email.message_from_bytes(data[0][1],
                                        _class=email.message.EmailMessage)
Return the response email message.
Return the response email message.
Return the response email message .
def _get_response(
            self,
            from_email: str,
            subject: str,
    ) -> email.message.EmailMessage:
        matches = self.get_response(from_email, subject)
        if not matches:
            raise RuntimeError('No messages found')
        return_code, data = self._imap.fetch(matches[0], '(RFC822)')
        if return_code != 'OK':
            raise RuntimeError(
                f"Got return code '{return_code}' from fetching")
        return email.message_from_bytes(data[0][1],
                                        _class=email.message.EmailMessage)
def _get_response ( self , from_email : str , subject : str , ) -> email . message . EmailMessage : matches = self . get_response ( from_email , subject ) if not matches : raise RuntimeError ( 'No messages found' ) return_code , data = self . _imap . fetch ( matches [ 0 ] , '(RFC822)' ) if return_code != 'OK' : raise RuntimeError ( f"Got return code '{return_code}' from fetching" ) return email . message_from_bytes ( data [ 0 ] [ 1 ] , _class = email . message . EmailMessage )
Return the response email message.
Return the response email message .
"""Return the response email message."""
self
from_email
str
subject
str