mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: add "Reset to Default HTML" button
This commit is contained in:
@ -1405,3 +1405,53 @@ export function getCurrencySymbol(currency) {
|
||||
return currency;
|
||||
}
|
||||
}
|
||||
|
||||
export function getFriendlyUserName(account) {
|
||||
if (account.firstName !== "" && account.lastName !== "") {
|
||||
return `${account.firstName}, ${account.lastName}`;
|
||||
} else if (account.displayName !== "") {
|
||||
return account.displayName;
|
||||
} else if (account.name !== "") {
|
||||
return account.name;
|
||||
} else {
|
||||
return account.id;
|
||||
}
|
||||
}
|
||||
|
||||
export function getDefaultHtmlEmailContent() {
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Verification Code Email</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; }
|
||||
.email-container { width: 600px; margin: 0 auto; }
|
||||
.header { text-align: center; }
|
||||
.code { font-size: 24px; margin: 20px 0; text-align: center; }
|
||||
.footer { font-size: 12px; text-align: center; margin-top: 50px; }
|
||||
.footer a { color: #000; text-decoration: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="header">
|
||||
<h3>Casbin Organization</h3>
|
||||
<img src="https://cdn.casbin.org/img/casdoor-logo_1185x256.png" alt="Casdoor Logo" width="300">
|
||||
</div>
|
||||
<p><strong>%{user.friendlyName}</strong>, here is your verification code</p>
|
||||
<p>Use this code for your transaction. It's valid for 5 minutes</p>
|
||||
<div class="code">
|
||||
%s
|
||||
</div>
|
||||
<p>Thanks</p>
|
||||
<p>Casbin Team</p>
|
||||
<hr>
|
||||
<div class="footer">
|
||||
<p>Casdoor is a brand operated by Casbin organization. For more info please refer to <a href="https://casdoor.org">https://casdoor.org</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user