PyEmailerAJM 1.1__tar.gz → 1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyEmailerAJM
3
- Version: 1.1
3
+ Version: 1.3
4
4
  Summary: Allows for automating sending Email with the Outlook Desktop client. Future releases will add more client support
5
5
  Home-page: https://github.com/amcsparron2793-Water/PyEmailer
6
6
  Author: Amcsparron
7
7
  Author-email: amcsparron@albanyny.gov
8
8
  License: MIT License
9
- Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.1.tar.gz
9
+ Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.3.tar.gz
10
10
  Keywords: Outlook,Email,Automation
11
11
  Platform: UNKNOWN
12
12
  License-File: LICENSE.txt
@@ -20,6 +20,9 @@ class EmailerNotSetupError(Exception):
20
20
 
21
21
 
22
22
  class PyEmailer:
23
+ # the email tab_char
24
+ tab_char = ' '
25
+
23
26
  def __init__(self, display_window: bool,
24
27
  send_emails: bool, logger: Logger = None,
25
28
  auto_send: bool = False,
@@ -83,11 +86,29 @@ class PyEmailer:
83
86
  self._logger.error(e, exc_info=True)
84
87
  raise e
85
88
 
86
- def FindMsgBySubject(self, subject: str) -> list:
89
+ def FindMsgBySubject(self, subject: str, forwarded_message_match: bool = True,
90
+ reply_msg_match: bool = True) -> list:
91
+ """Matches the message.Subject string to the subject attr string and returns a list of messages.
92
+ If forward_message_match is True than messages are matched without
93
+ regard to if they start with 'FW:' or 'FWD:'"""
87
94
  matched_messages = []
88
95
  for message in self.GetMessages():
89
- if message.Subject == subject:
90
- matched_messages.append(message)
96
+ if forwarded_message_match:
97
+ if (message.Subject == subject or
98
+ (message.Subject.startswith('FW:')
99
+ and message.Subject.split('FW:')[1].strip() == subject) or
100
+ (message.Subject.startswith('FWD:')
101
+ and message.Subject.split('FWD:')[1].strip() == subject)):
102
+ matched_messages.append(message)
103
+ if reply_msg_match:
104
+ if (message.Subject == subject or
105
+ (message.Subject.startswith('RE:')
106
+ and message.Subject.split('RE:')[1].strip() == subject)):
107
+ matched_messages.append(message)
108
+ else:
109
+ if message.Subject == subject:
110
+ matched_messages.append(message)
111
+
91
112
  return matched_messages
92
113
 
93
114
  def SaveAllEmailAttachments(self, msg, save_dir_path):
@@ -233,9 +254,9 @@ if __name__ == "__main__":
233
254
  "subject": f"TEST: Your TEST "
234
255
  f"agreement expires in 30 days or less!",
235
256
  "text": "testing to see if the attachment works",
236
- "recipient": 'pbehnke@albanyny.gov',
257
+ "recipient": 'test',
237
258
  "attachments": []
238
259
  }
239
260
  #   is the tab character for emails
240
- emailer.SetupEmail(**r_dict) # recipient="amcsparron@albanyny.gov", subject="test subject", text="test_body")
261
+ emailer.SetupEmail(**r_dict) # recipient="test", subject="test subject", text="test_body")
241
262
  emailer.SendOrDisplay()"""
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyEmailerAJM
3
- Version: 1.1
3
+ Version: 1.3
4
4
  Summary: Allows for automating sending Email with the Outlook Desktop client. Future releases will add more client support
5
5
  Home-page: https://github.com/amcsparron2793-Water/PyEmailer
6
6
  Author: Amcsparron
7
7
  Author-email: amcsparron@albanyny.gov
8
8
  License: MIT License
9
- Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.1.tar.gz
9
+ Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.3.tar.gz
10
10
  Keywords: Outlook,Email,Automation
11
11
  Platform: UNKNOWN
12
12
  License-File: LICENSE.txt
@@ -0,0 +1,10 @@
1
+ # <u>PyEmailerAJM</u>
2
+ ### <i>Makes automating Outlook emails quick and easy</i>
3
+
4
+ - PyEmailerAJM uses pywin32 to automate the sending/reading of Outlook emails.
5
+
6
+ <b>Import</b>
7
+
8
+ import PyEmailer class using `from PyEmailerAJM.PyEmailerAJM import PyEmailer`
9
+
10
+ see [OutlookPywin32Commands.xlsx](OutlookPywin32Commands.xlsx) for list of commands that can be used with a message object.
@@ -2,10 +2,10 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='PyEmailerAJM',
5
- version='1.1',
5
+ version='1.3',
6
6
  packages=['PyEmailerAJM'],
7
7
  url='https://github.com/amcsparron2793-Water/PyEmailer',
8
- download_url='https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.1.tar.gz',
8
+ download_url='https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.3.tar.gz',
9
9
  keywords=["Outlook", "Email", "Automation"],
10
10
  install_requires=['pywin32'],
11
11
  license='MIT License',
@@ -1,8 +0,0 @@
1
- # <u>PyEmailerAJM</u>
2
- ### <i>Makes automating Outlook emails quick and easy</i>
3
-
4
- - PyEmailerAJM uses pywin32 to automate the sending of Outlook emails.
5
-
6
- <b>Import</b>
7
-
8
- import PyEmailer class using `from PyEmailerAJM.PyEmailerAJM import PyEmailer`
File without changes
File without changes