mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
do not use formataddr to generate website email
This commit is contained in:
parent
00f3b7b532
commit
c597a4b9fe
1 changed files with 11 additions and 4 deletions
|
@ -729,11 +729,18 @@ class ForwardEmail(db.Model, ModelMixin):
|
||||||
website_name, _ = parseaddr(self.website_from)
|
website_name, _ = parseaddr(self.website_from)
|
||||||
|
|
||||||
if website_name:
|
if website_name:
|
||||||
return formataddr(
|
# remove all double quote
|
||||||
(website_name + " " + self.website_email, self.reply_email)
|
website_name = website_name.replace('"', "")
|
||||||
)
|
return f'"{website_name} {self.website_email}" <{self.reply_email}>'
|
||||||
|
|
||||||
return formataddr((self.website_email.replace("@", " at "), self.reply_email))
|
# cannot use formataddr here as this field is for email client, not for MTA
|
||||||
|
# return formataddr(
|
||||||
|
# (website_name + " " + self.website_email, self.reply_email)
|
||||||
|
# )
|
||||||
|
|
||||||
|
name = self.website_email.replace("@", " at ").replace('"', "")
|
||||||
|
return f'"{name}" <{self.reply_email}>'
|
||||||
|
# return formataddr((self.website_email.replace("@", " at "), self.reply_email))
|
||||||
|
|
||||||
def last_reply(self) -> "ForwardEmailLog":
|
def last_reply(self) -> "ForwardEmailLog":
|
||||||
"""return the most recent reply"""
|
"""return the most recent reply"""
|
||||||
|
|
Loading…
Reference in a new issue