Skip to content

Commit

Permalink
feat: add footer to annoucement emails
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed May 2, 2024
1 parent d80dba7 commit 25eddab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/messages.astro
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ if (Astro.request.method === "POST") {
.map((user) => ({ email: user.email, name: user.name }));
}
message += " \n\n-----\n\n";
message += `*This email was sent by MagicSnap because you are a member of ${session.teamName}. If you have any questions or need assistance, please contact us at spellcheck@magicsnap.org.*`;
const email = {
to: "annoucements@magicsnap.org",
bcc: userList,
from: "magic.broadcast@magicsnap.org",
subject: subject,
text: message,
markdown: message,
};
const lastEmailHash = (
Expand All @@ -102,7 +105,7 @@ if (Astro.request.method === "POST") {
.from(Organization)
.where(
and(
like(Organization.lastMessageHash, Md5.hashStr(email.text)),
like(Organization.lastMessageHash, Md5.hashStr(email.markdown)),
like(Organization.team, session.team)
)
)
Expand Down Expand Up @@ -139,7 +142,7 @@ if (Astro.request.method === "POST") {
await db
.update(Organization)
.set({
lastMessageHash: Md5.hashStr(email.text),
lastMessageHash: Md5.hashStr(email.markdown),
})
.where(like(Organization.team, session.team));
Expand Down

0 comments on commit 25eddab

Please sign in to comment.