in components/processing/libs/processor-msg/src/processors/msg/msg_generator.py [0:0]
def save(self, msg_file: GCSPath):
# Timestamp
ts = self.fake.past_datetime("-5y")
# Body of email
body_paragraphs = self.fake.random_int(min=4, max=20)
paragraphs = (
[self.fake.sentence(2)]
+ [self.fake.paragraph(10) for i in range(body_paragraphs)]
+ [self.fake.sentence(2)]
)
# Create the raw message file
with msg_file.write_as_file() as f:
create_msg_file(
omsg=f,
hdrs=[
f"Date: {email.utils.format_datetime(ts)}",
f"From: {self.get_person()}",
f"To: {self.get_people(min=1, max=4)}",
f"Cc: {self.get_people(min=0, max=10)}",
],
subject=self.fake.sentence(),
body="\n\n".join(paragraphs),
timestamp=ts,
att=self.get_attachments(),
)