> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/product/features/reports/daily-report.md).

# Daily group report

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/product/features/daily-report.md).
{% endhint %}

A group can have a **daily group report**. It is switched on in the group's settings with "Send daily group email report to all group admins". The setting's text promises every group admin with an email address in their profile a daily email of the tasks created the day before, with checklist reports where relevant. In the code, the report is a PDF of the group's tasks with activity on the report day, stored in the reports bucket. No code in the repos starts the daily run, sends the email or picks its recipients \[[ASK-13](https://github.com/snapfix/docs/blob/main/ASK.md#ask-13-which-services-and-scheduled-jobs-run-in-production), [ASK-121](https://github.com/snapfix/docs/blob/main/ASK.md#ask-121-what-sends-the-daily-group-email-and-to-whom)].

## Rules

* The switch is per group and off by default. On the web it is in the group settings drawer, under "Communication & Media Restrictions"; iOS and Android have it in the group's details ([Group settings](https://docs.snapfix.com/how-the-apps-work/screens/groups/group-settings.md#settings-drawer-web)). It saves as `dailyGroupEmailAndReport` with the group ([`PUT /v1/app/businesses/{uuid}`](https://docs.snapfix.com/engineering-reference/api/groups.md#put-v1appbusinessesuuid)).
* All three hide the switch for asset registers (ios @ aa31967ac8, `BusinessDetailsVC.swift:840`; android @ 86068bfeea, `BusinessDetailsFragment.java:527`).
* The plan switch `dailygroupemailreport_enabled` is stored, but no screen or endpoint reads it \[[ASK-23](https://github.com/snapfix/docs/blob/main/ASK.md#ask-23-should-plan-limits-be-enforced-on-the-web-and-the-server)].
* Recipients, by the setting's text: every group admin with an email address in their profile. No code in the repos chooses them \[[ASK-121](https://github.com/snapfix/docs/blob/main/ASK.md#ask-121-what-sends-the-daily-group-email-and-to-whom)].
* The report day is the day before, unless the request names a date. It is read in the site's time zone, or UTC when the site has none ([`daily_group_report`](https://docs.snapfix.com/engineering-reference/api/reports.md#post-actiondaily_group_report); php-apis @ 238ca4414e, `daily_group_email_report_v1.php:28-29`).
* The report covers the group's tasks with a chat entry, creation or change on the report day, and lists each task's checklist items. The setting's text says "tasks created the previous day".
* The builder sends no email ([`daily_group_report`](https://docs.snapfix.com/engineering-reference/api/reports.md#post-actiondaily_group_report)).
* The PDF is public by its link, and its name carries the site's and the group's names.
* The php-apis action takes the server's Basic login instead of a user token \[[ASK-12](https://github.com/snapfix/docs/blob/main/ASK.md#ask-12-which-settings-do-the-production-api-servers-use)]; its only caller, apipy's `POST /daily-group-report`, takes the shared app login, and no code calls that route.

## Flow

```mermaid
flowchart TD
    setting["Switch on for a group"] --> saved["Saved with the group's settings"]
    saved -.-> run["A daily run, outside the repos"]
    run --> pdf["Build the PDF for the day before"]
    pdf --> any{"Tasks with activity that day?"}
    any -- no --> nofile["Row marked completed, no file"]
    any -- yes --> file["Row marked completed, PDF in the reports bucket"]
    file -.-> mail["Email to group admins: no sender in the repos"]
```

## Platforms

| Capability                 | Web                   | iOS           | Android       |
| -------------------------- | --------------------- | ------------- | ------------- |
| The switch                 | Group settings drawer | Group details | Group details |
| Hidden for asset registers | Yes                   | Yes           | Yes           |
| See the report or its link | No                    | No            | No            |

## Screens

* [Group settings](https://docs.snapfix.com/how-the-apps-work/screens/groups/group-settings.md): where the switch is.

## API and data

* [`PUT /v1/app/businesses/{uuid}`](https://docs.snapfix.com/engineering-reference/api/groups.md#put-v1appbusinessesuuid): saves the switch with the group.
* [`daily_group_report`](https://docs.snapfix.com/engineering-reference/api/reports.md#post-actiondaily_group_report): builds the PDF and its report row. apipy's `POST /daily-group-report` is its only caller (no caller in the repos).
* Tables: [`tPri_SettingsBusiness`](https://docs.snapfix.com/engineering-reference/db/tables/tpri_settingsbusiness.md) (the switch, `fDailyGroupEmailAndReport`) and [`report_userreports`](https://docs.snapfix.com/engineering-reference/db/tables/report_userreports.md) (the report row, with the group as its owner, of type `daily_group_report`).

## Depends on

* [Groups](https://docs.snapfix.com/product/features/groups/groups.md): the group and its settings.
* [Group members](https://docs.snapfix.com/product/features/groups/group-members.md): the group admins the text names.
* [Tasks](https://docs.snapfix.com/product/features/tasks/tasks.md) and [Checklists](https://docs.snapfix.com/product/features/checklists/checklists.md): the tasks and checklist items in the PDF.
* [Asset registers](https://docs.snapfix.com/product/features/assets/asset-registers.md): the registers the switch is hidden for.

## Edge cases

* **A day with no matching task:** no PDF is written, but the row is still marked completed, with a link to a file that does not exist.
* **An admin with no email address:** gets no email, by the setting's text.
* **Asset registers:** the switch is hidden on every platform, but the group update accepts the field for them too.
* **Where to see it:** no screen lists daily reports, because their owner is the group, not a user.
* **The email:** its content, sender and timing are not in the repos \[[ASK-13](https://github.com/snapfix/docs/blob/main/ASK.md#ask-13-which-services-and-scheduled-jobs-run-in-production)].


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/product/features/reports/daily-report.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
