feat: add admin endpoint to send digest emails for users
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 1m37s
Some checks failed
Chore App Build, Test, and Push Docker Images / build-and-push (push) Failing after 1m37s
- Implemented a new endpoint `/admin/test/send-digest` in `admin_api.py` to trigger digest emails for specific users. - Added a script `send_digest.py` to facilitate sending digest emails via the admin API. - Enhanced the digest action handling in `digest_action_api.py` to support token peeking without consuming it. - Updated the `send_digests` function in `digest_scheduler.py` to utilize the new `send_digest_for_user` function for sending emails. - Introduced a new utility function `peek_token` in `digest_token.py` to validate tokens without consuming them. - Modified the `ParentView.vue` component to handle digest actions upon receiving a digest token in the URL. - Updated `.gitignore` to exclude sensitive certificate files.
This commit is contained in:
@@ -651,6 +651,24 @@ onMounted(async () => {
|
||||
const idParam = Array.isArray(route.params.id) ? route.params.id[0] : route.params.id
|
||||
const scrollToId = typeof route.query.scrollTo === 'string' ? route.query.scrollTo : null
|
||||
const entityType = typeof route.query.entityType === 'string' ? route.query.entityType : null
|
||||
const digestToken =
|
||||
typeof route.query.digestToken === 'string' ? route.query.digestToken : null
|
||||
|
||||
if (digestToken) {
|
||||
try {
|
||||
const res = await fetch(`/api/digest-action/${digestToken}`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
})
|
||||
if (!res.ok) {
|
||||
const data = await res.json().catch(() => ({}))
|
||||
console.warn('Digest action failed:', data.error || res.status)
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Digest action request failed:', e)
|
||||
}
|
||||
}
|
||||
|
||||
if (idParam !== undefined) {
|
||||
const promise = fetchChildData(idParam)
|
||||
promise.then((data) => {
|
||||
|
||||
Reference in New Issue
Block a user