Skip to content

Commit

Permalink
created function to append the initial message headers to the parsed …
Browse files Browse the repository at this point in the history
…initial message content
  • Loading branch information
benne238 committed Jun 29, 2021
1 parent 5738191 commit c7e0d0a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/webqueue2api/parser/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,27 @@ def __parseSections(self) -> list:

return body_sections

def __add_initial_message_headers(self, initial_message: dict) -> dict:
"""Adds header information to the intial message
Example:
[example]
Args:
initial_message (dict): the intial message dictionary without any headers
Returns:
dict: modified initial message dictionary to include headers
"""
initial_message["datetime"] = self.date_received
initial_message["from_name"] = self.user_name
initial_message["from_email"] = self.user_email
initial_message["to"] = self.__get_most_recent_header_by_type("To")
initial_message["cc"] = self.__get_most_recent_header_by_type("CC")
initial_message["subject"] = self.subject

return initial_message

def __getSortedSections(self, sectionsList: list) -> list:
"""Sorts the sections chronologically by datetime
Expand Down

0 comments on commit c7e0d0a

Please sign in to comment.