PDS Admin tool make it easier to moderate your PDS with labels

Implement email notifications for new accounts #2

merged opened by tophhie.cloud targeting main from tophhie.cloud/tc-label-watcher: main

PR to support email notifications for new accounts.

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:ggobmtqnjirtchpwgydxoecb/sh.tangled.repo.pull/3mhfzjtycmj22
+10 -8
Interdiff #0 โ†’ #1
settings.toml.example

This file has not been changed.

+10 -8
src/handlers/pdsSubscriber.ts
··· 41 41 "Identity event", 42 42 ); 43 43 if (config.notifyOnNewAccounts) { 44 - await queue.add(() => 45 - sendNewAccountNotification(config.notifyEmails, { 46 - did: message.did, 47 - pds: config.host 48 - }).catch((err) => { 49 - logger.error({ err }, "Error sending new account notification email") 50 - }) 51 - ); 44 + if (message.active == true) { 45 + await queue.add(() => 46 + sendNewAccountNotification(config.notifyEmails, { 47 + did: message.did, 48 + pds: config.host 49 + }).catch((err) => { 50 + logger.error({ err }, "Error sending new account notification email") 51 + }) 52 + ); 53 + } 52 54 } 53 55 await queue.add(() => 54 56 handleNewIdentityEvent(
src/mailer.ts

This file has not been changed.

src/types/settings.ts

This file has not been changed.

History

2 rounds 1 comment
sign up or login to add to the discussion
4 commits
expand
Added email notifications for new accounts
Fixed overload match issue
Logging
Notify for only active accounts
expand 1 comment

Looks great to me! Thank you!

pull request successfully merged
3 commits
expand
Added email notifications for new accounts
Fixed overload match issue
Logging
expand 0 comments