Skip to content

Commit

Permalink
fix: set email footer from $SITE_ORIGIN (#25)
Browse files Browse the repository at this point in the history
* set email footer from $SITE_ORIGIN
  • Loading branch information
jokester authored Oct 21, 2024
1 parent 5d66052 commit c36e115
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# 【请修改】在导出文件及邮件中显示
SITE_NAME=萌翻local
SITE_ORIGIN=https://change-me.com
# 【请修改】用于加密用户 session,请配置一个很长的密钥,建议配置为 64 位以上字母数字组成的密钥
# 可用使用 python -c 'import secrets; print(secrets.token_hex())' 命令来随机生成一个
SECRET_KEY=CHANGE_ME
Expand Down
1 change: 1 addition & 0 deletions .env.test.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
TESTING=YES
LOG_LEVEL=DEBUG
SITE_NAME=萌翻TEST
SITE_ORIGIN=https://test.moeflow.org
SECRET_KEY=SECRET
[email protected]

Expand Down
1 change: 1 addition & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# 基础设置
# -----------
SITE_NAME = env["SITE_NAME"]
SITE_ORIGIN = env["SITE_ORIGIN"]
SECRET_KEY = env["SECRET_KEY"] # 必填 - 密钥
LOG_LEVEL = env.get("LOG_LEVEL", "INFO")
# DEPRECATED: please use modern container logging collector
Expand Down
2 changes: 1 addition & 1 deletion app/models/v_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def to_email(self, address: str) -> None:
template_data={
"code": self.content,
"site_name": current_app.config.get("SITE_NAME"),
"site_url": f'https://{current_app.config.get("DOMAIN")}',
"site_url": current_app.config.get("SITE_ORIGIN"),
},
)
self.send_time = datetime.datetime.utcnow()
Expand Down

0 comments on commit c36e115

Please sign in to comment.