Mercurial Hosting > chat
comparison src/lib/Notify.luan @ 87:246a792adedf
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 12 Mar 2025 14:20:10 -0600 |
parents | e138343b2c76 |
children |
comparison
equal
deleted
inserted
replaced
86:625ffdf6499d | 87:246a792adedf |
---|---|
58 -- logger.info("notify") | 58 -- logger.info("notify") |
59 local now = time_now() | 59 local now = time_now() |
60 for user_id, when in pairs(shallow_copy(users)) do | 60 for user_id, when in pairs(shallow_copy(users)) do |
61 if now - when > wait then | 61 if now - when > wait then |
62 local user = get_user_by_id(user_id) | 62 local user = get_user_by_id(user_id) |
63 local name = user.name | |
64 local you = name and name..", you" or "You" | |
63 -- logger.info("notify "..user.notify_email.." "..user_id) | 65 -- logger.info("notify "..user.notify_email.." "..user_id) |
64 send_mail { | 66 send_mail { |
65 To = user.notify_email | 67 To = user.notify_email |
66 Subject = "New Messages" | 68 Subject = "New Messages" |
67 body = `%> | 69 body = `%> |
68 You have received new messages. | 70 <%=you%> have received new messages. |
69 | 71 |
70 <%= base_url %>/ | 72 <%= base_url %>/ |
71 | 73 |
72 To unsubscribe: | 74 To unsubscribe: |
73 <%= base_url %>/unsubscribe.html?user=<%=user_id%>&password=<%=user.password%> | 75 <%= base_url %>/unsubscribe.html?user=<%=user_id%>&password=<%=user.password%> |