adding the user account into the email, ty @Randl for the suggestion. I think this should be ok to include in plain text here because it is an email direct to the user

This commit is contained in:
Andrej Karpathy
2021-12-07 22:27:14 -08:00
parent 1153a70563
commit 28163bfcb7
+6 -3
View File
@@ -64,7 +64,7 @@ body {
<br><br>
<div>
To stop these emails remove your email in your <a href="https://arxiv-sanity-lite.com/profile">account</a> settings.
To stop these emails remove your email in your <a href="https://arxiv-sanity-lite.com/profile">account</a> settings. (your account is __ACCOUNT__).
</div>
<div> <3, arxiv-sanity-lite. </div>
@@ -115,7 +115,7 @@ def calculate_recommendation(
# -----------------------------------------------------------------------------
def render_recommendations(tags, pids, scores):
def render_recommendations(user, tags, pids, scores):
# render the paper recommendations into the html template
parts = []
@@ -157,6 +157,9 @@ def render_recommendations(tags, pids, scores):
the better this gets:"
out = out.replace('__STATS__', stats)
# render the account
out = out.replace('__ACCOUNT__', user)
return out
# -----------------------------------------------------------------------------
@@ -243,7 +246,7 @@ if __name__ == "__main__":
# render the html
print("rendering top %d recommendations into a report..." % (args.num_recommendations, ))
html = render_recommendations(tags, pids, scores)
html = render_recommendations(user, tags, pids, scores)
# temporarily for debugging write recommendations to disk for manual inspection
if os.path.isdir('recco'):
with open('recco/%s.html' % (user, ), 'w') as f: