Spaces:
Sleeping
Sleeping
Updated the email body
Browse files
notify.py
CHANGED
|
@@ -70,16 +70,31 @@ def send_email(isbn, status, issues, overlay_url, confidence, to_email):
|
|
| 70 |
"to_email": to_email,
|
| 71 |
"subject": f"BookLeaf Cover Validation: {status}",
|
| 72 |
"body": f"""
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
Issues: {', '.join(issues) if isinstance(issues, list) else issues}
|
| 77 |
-
Confidence: {confidence}%
|
| 78 |
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
|
| 85 |
try:
|
|
|
|
| 70 |
"to_email": to_email,
|
| 71 |
"subject": f"BookLeaf Cover Validation: {status}",
|
| 72 |
"body": f"""
|
| 73 |
+
<html>
|
| 74 |
+
<body style="font-family: Arial, sans-serif; color: #222;">
|
| 75 |
+
<p>Dear Author,</p>
|
| 76 |
|
| 77 |
+
<p>Your book cover has been reviewed by the automated validation system.</p>
|
|
|
|
|
|
|
| 78 |
|
| 79 |
+
<table style="border-collapse: collapse; margin: 15px 0;">
|
| 80 |
+
<tr><td><strong>Status:</strong></td><td>{'✅ PASS' if status == 'PASS' else '❌ REVIEW NEEDED'}</td></tr>
|
| 81 |
+
<tr><td><strong>Confidence Score:</strong></td><td>{confidence}%</td></tr>
|
| 82 |
+
<tr><td><strong>Detected Issues:</strong></td><td>{', '.join(issues) if isinstance(issues, list) else issues}</td></tr>
|
| 83 |
+
</table>
|
| 84 |
|
| 85 |
+
<p>
|
| 86 |
+
{f'<a href="{overlay_url}" style="color:#1a73e8;">View annotated cover overlay</a>' if overlay_url else 'No overlay available.'}
|
| 87 |
+
</p>
|
| 88 |
+
|
| 89 |
+
<p>
|
| 90 |
+
If your status is <strong>REVIEW NEEDED</strong>, please address the issues listed above and re-upload your revised cover.
|
| 91 |
+
</p>
|
| 92 |
+
|
| 93 |
+
<p>Thank you,<br>
|
| 94 |
+
<strong>BookLeaf Validation Team</strong></p>
|
| 95 |
+
</body>
|
| 96 |
+
</html>
|
| 97 |
+
""",
|
| 98 |
}
|
| 99 |
|
| 100 |
try:
|