Skip to content
DailyOratory

Prayer Chain workflow

Moderate before routing.

  1. 1New request enters the Intake sheet as new or pending-review.
  2. 2Coordinator removes identifying details and chooses privacy, urgency, category, and team routing.
  3. 3Approved routed rows sync to Team Dashboard sheets by assignedTeamIds.
  4. 4Urgent rows create an immediate alert only after duplicate suppression checks.
  5. 5Ordinary rows are collected into same-day or daily digest sheets.
  6. 6Thanksgiving updates enter a separate review sheet before being shared with teams.
  7. 7Youth-safe and pastoral referral rows remain coordinator-only until reviewed.

Supabase schema

Tables for routed prayer support

TableColumnTypeNotes
prayer_chain_requestsiduuid primary keyInternal request ID.
prayer_chain_requeststitletext not nullCoordinator-safe title.
prayer_chain_requestsrequest_summarytext not nullModerated team-facing summary.
prayer_chain_requestsprivate_coordinator_notetextCoordinator-only details.
prayer_chain_requestsrequest_categorytext not nullHealing, grief, family, parish, youth, etc.
prayer_chain_requestsurgencytext not nullordinary, time-sensitive, or urgent.
prayer_chain_requestsprivacytext not nullControls who can see the request.
prayer_chain_requestsmoderation_statustext not nullCoordinator workflow state.
prayer_chain_requestsrequested_by_displaytextMay be Anonymous.
prayer_chain_requestsrequester_contact_encryptedtextAdmin-only encrypted contact.
prayer_chain_requestsassigned_team_idstext[] not nullRouted team IDs.
prayer_chain_requestsalert_cadencetext not nullImmediate or digest mode.
prayer_chain_requestsprayed_countinteger default 0Aggregated team prayer commitments.
prayer_chain_requestssubmitted_attimestamptz not nullOriginal submission time.
prayer_chain_requestsrouted_attimestamptzSet after moderation/routing.
prayer_chain_teamsidtext primary keyTeam ID such as urgent or rosary.
prayer_chain_membershipsuser_iduuid references auth.usersTeam member account.
prayer_chain_membershipsteam_idtext references prayer_chain_teamsMembership team.
prayer_chain_commitmentsrequest_iduuid references prayer_chain_requestsOne prayer click per member/request/team.
prayer_chain_alert_deliveriesdedupe_keytext uniqueSuppress duplicate alerts.

RLS policies

  • Requesters can insert their own requests but cannot publish or route them.
  • Requesters can read only a minimal confirmation for their own request when authenticated.
  • Team members can read approved/routed requests assigned to their team.
  • Team members cannot read requester contact fields or private coordinator notes.
  • Coordinators can read and update moderation fields for requests in their responsibility.
  • Youth-safe and pastoral-referral requests require coordinator role claims before any read access.
  • Prayer commitments can be inserted once per user, request, and team.
  • Alert delivery rows are writable only by server-side service role jobs.

Apps Script plan

  • onFormSubmit: append request to Intake, normalize fields, and set moderationStatus to pending-review.
  • routeRequest: apply the Daily Oratory routing table to suggest assignedTeamIds and alertCadence.
  • dedupeAlert: build a key from requestId, teamId, alertType, and time window before sending.
  • sendUrgentAlerts: email or message only trusted urgent coordinators after approval.
  • sendDailyDigest: group approved requests by team and send a calm digest at a scheduled time.
  • syncThanksgivings: collect approved thanksgiving updates and attach them to the original request.
  • auditLog: write every moderation, routing, alert, and digest action to an immutable log sheet.