Commit 33365810 authored by kaiyou's avatar kaiyou

Fix the title for sending to gmail

parent 15f4fdd1
Pipeline #262 passed with stage
in 1 minute and 12 seconds
......@@ -49,8 +49,8 @@ def send_mail(context, account, to, message):
)
smtp.login(account["username"], account["password"])
mail = multipart.MIMEMultipart("alternative")
mail["Subject"] = fake.sentence(nb_words=6, variable_nb_words=True)
mail["Subject"] += message
sentence = fake.sentence(nb_words=6, variable_nb_words=True)[:-1]
mail["Subject"] = f"[{message}] {sentence}]
mail["From"] = account["username"]
mail["To"] = to
mail.attach(text.MIMEText("\n".join(fake.paragraphs(nb=5)), "text"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment