WhatsApp Groups¶
Part of the Aashray Business Logic. Related: Adhyayan & Utsav, Notifications, Short Links & App Updates, Accounts, Identity & Authentication.
An Utsav or an Adhyayan can have a WhatsApp group for its participants. Staff create the group in WhatsApp and paste its invite link into the Utsav or Adhyayan. Aashray then does three things:
- It gives the group a short link and puts a "join the group" button in booking confirmation messages.
- It lets staff compare the group's members with the confirmed bookings.
- It lets staff remind people who have not joined, and remove people who have no booking.
Aashray uses two WhatsApp channels:
| Channel | What it is | What it does here |
|---|---|---|
| WhatsApp Business sender | The official sender for all booking messages | Sends booking confirmations with the group button, and the join reminders |
| Linked WhatsApp account | An ordinary WhatsApp account that staff link to the backend by scanning a QR code, as for WhatsApp Web | Reads a group's members, finds the group behind an invite link, and removes people from a group |
A separate WhatsApp service in the backend runs the linked WhatsApp account. It works through a queue of jobs (see "How the WhatsApp service runs jobs," below). The member app has no WhatsApp group feature. Members join through the link.
Who can use it¶
The staff panel's WhatsApp Automation screen shows an Utsav tab and an Adhyayan tab (staff panel and backend).
| Role | Tabs shown | Can remove members and send reminders |
|---|---|---|
| Super admin | Utsav and Adhyayan | Yes |
| Utsav admin | Utsav | Yes |
| Adhyayan admin | Adhyayan | Yes |
| Office admin | Utsav and Adhyayan | Adhyayan only (see "Known limitations today") |
| Utsav read-only role | Utsav | No. View and member check only. |
| Adhyayan read-only role | Adhyayan | No. View and member check only. |
- Only the four roles that can act see the connection status and the QR code (backend).
- A temporary access link cannot open the screen (staff panel).
- The same member check also opens from the "Audit & Send Reminders" button in the Utsav report and the Adhyayan report. These reports also have "Copy WhatsApp Shortlink" (staff panel).
The group link on an Utsav or Adhyayan¶
- Staff paste the group's invite link in the "WhatsApp Group Link" field when they create or edit an Utsav or Adhyayan (staff panel).
- Short link (backend). On save, the backend points a fixed short link at the invite link. Its name is "u" and the Utsav number, or "a" and the Adhyayan number, for example u12. The short link is active and counts clicks, like any staff short link (see Short links).
- Group lookup (backend). When the link is a WhatsApp invite link, the backend also queues a lookup. The WhatsApp service asks WhatsApp which group the invite belongs to, and records that group on the Utsav or Adhyayan. On an edit, the lookup runs only when the link changed. If the invite is not valid, the lookup fails and no new group is recorded.
- Group list (staff panel). The screen lists each Utsav, newest first, and each Adhyayan, from this month onward with the nearest first, then past ones with the most recent first. Each row shows the name, the start date, the recorded group ("Not Created" when there is none), the link ("Link Added" with the short link, or "No Link"), and the "Audit Reconciliation" button.
Messages that carry the group link (backend)¶
| Event | Message | Recipient |
|---|---|---|
| A new Utsav booking is confirmed straight away | Booking confirmation with a button that opens the group short link | The member. When someone else made the booking, the booker and the attendee. |
| An Utsav booking moves from waitlisted or payment pending to confirmed | Status message with the group button | The attendee, and the booker when someone else made the booking |
| Staff change an Adhyayan booking from payment pending to confirmed | Status message with the group button | The attendee |
| Staff send a join reminder | Reminder with the member's name, the Utsav or Adhyayan name, and the group button | The person not yet in the group |
An online payment for an Adhyayan sends no WhatsApp, so the member gets no group button then. Other booking messages have no group button. Notifications, Short Links & App Updates owns the general booking-message rules.
Checking who has joined¶
Staff open the member check ("Audit Reconciliation") for one Utsav or Adhyayan. The backend compares the group's current members with the people who are expected in it (backend).
- Expected people. For an Utsav: bookings that are confirmed, paid by cash, or checked in. For an Adhyayan: confirmed bookings only. When the group is read, a booking whose card has no mobile number is left out.
- Reading the group. The backend queues a high-priority job for the WhatsApp service to read the group's members, and waits up to about 12 seconds for the answer.
- Matching. A person counts as joined when a group member's number equals their number with its country code, equals their stored number, or ends with the last 10 digits of their stored number.
The check shows three lists, each with the name, card number and phone number:
| List | Who is in it | Actions (roles that can act) |
|---|---|---|
| Matched | Expected people who are in the group | None |
| Missing | Expected people who are not in the group | "Send Reminder" for one person, or "Send Template Reminder to All Missing" |
| Extra | Group members with no matching expected booking. A registered number shows the member's name. Any other number shows "Unknown User". | "Remove" for one person, or "Remove all" |
- If no group is recorded for the Utsav or Adhyayan, the check does not read WhatsApp. Every expected person shows as missing.
- If reading the group fails or takes longer than about 12 seconds, the check also shows every expected person as missing, with no error (see "Known limitations today").
Removing people¶
- Each removal asks for confirmation. The backend then queues one high-priority removal job for each number (backend and staff panel).
- The page runs the check again 1 second later (staff panel).
- The backend can also queue an add for a number. If the person's privacy settings stop the add, the WhatsApp service sends them a direct message with the group's invite link. The staff panel has no add button.
Sending join reminders¶
- The reminder goes through the WhatsApp Business sender, not the linked WhatsApp account (backend).
- One person: the reminder goes to that number.
- All missing: the backend runs the member check again by itself. It then sends a reminder to each expected person with a mobile number who did not match. If no group is recorded, every expected person gets one. The page reports how many it sent.
- Super admins and Utsav admins can send Utsav reminders. Super admins, Adhyayan admins and office admins can send Adhyayan reminders (backend). Office admins are refused for Utsav reminders (see "Known limitations today").
Connecting the linked WhatsApp account¶
- The screen shows the connection status of the linked WhatsApp account and checks it every 10 seconds (staff panel). Staff can press "Refresh Status".
| Status shown | Meaning | What staff do |
|---|---|---|
| Connected | The WhatsApp service is signed in and runs jobs | Nothing |
| Connecting | The service is signing in | Wait |
| Action Required | The service needs a new sign-in. The screen shows a QR code. | Scan the code in WhatsApp under Linked Devices. The code changes after a while. Press "Refresh Status" for a new one. |
| Disconnected | The service is not connected | Wait for the service to reconnect or to show a QR code |
- Losing the connection (backend). When the connection closes, the WhatsApp service tries again after 5 seconds. If WhatsApp signed the device out, the service deletes the saved sign-in and shows a new QR code.
- WhatsApp lets only a group member read the member list, and only a group admin remove people (WhatsApp rule). The linked WhatsApp account must therefore be an admin of each group.
How the WhatsApp service runs jobs¶
The backend never talks to the linked WhatsApp account directly. It adds a job to a queue, and the WhatsApp service carries it out (backend).
- Order. The service runs one job at a time: high priority first, then the oldest. A job with a planned time waits until that time. Every job that staff actions create is high priority.
- Only while connected. Jobs wait in the queue while the account is not connected. When the queue is empty, the service looks again every 5 seconds.
- Pace. The service waits 1 second between jobs, and 2 to 5 seconds after a group message or poll.
- Retries. A job that hits an error goes back to the queue. After its third attempt it is marked failed. After an error, the service waits 10 seconds.
- No retry. When WhatsApp refuses to create a group, add a person, or remove a person, the job fails at once. A failed member read or invite lookup also fails at once.
- The service records the error on a failed job. No screen shows the queue or the errors.
Job types¶
| Job | What the WhatsApp service does | What starts it today |
|---|---|---|
| Find group from invite | Finds the group behind an invite link and records it on the Utsav or Adhyayan | Saving a new or changed group link |
| Read members | Lists the group's current members | The member check, and a reminder to all missing |
| Remove member | Removes a number from the group | "Remove" and "Remove all" in the member check |
| Add member | Adds a number. If privacy settings stop it, sends the person the invite link. | Nothing in the staff panel |
| Create group | Creates an empty group named after the Utsav or Adhyayan and its start date, set so that only admins can post. Refused when the Utsav or Adhyayan already has a group or a creation job is waiting. | Nothing in the staff panel |
| Change group settings | Changes the group's name, its description, or whether only admins can post. The backend waits up to 12 seconds for the result. | Nothing in the staff panel |
| Group message | Posts text, an image or a document to the group. It can fill in the Utsav or Adhyayan name, start date, venue and invite link. It counts how many members received and read it. | Nothing |
| Poll | Posts a single-choice poll to the group | Nothing |
Every night at midnight, the WhatsApp service deletes files uploaded for group messages that are older than 30 days (backend).
How this connects to other domains¶
- Adhyayan & Utsav (07): staff set the group link on the Utsav or Adhyayan. Booking statuses decide who is expected in the group. The Utsav and Adhyayan reports open the member check.
- Notifications, Short Links & App Updates (10): the group link becomes a staff short link. Booking confirmations and join reminders go through the WhatsApp Business sender.
- Accounts, Identity & Authentication (02): staff roles decide who can view and act. The member's card gives the mobile number and country used for matching.
Known limitations today¶
What the screen offers
- Nothing adds booked members to a group. No booking, payment or staff action adds anyone. Members must use the link or the reminder.
- Group messages, polls, group creation and group settings cannot be used. The WhatsApp service and the backend support them, but no staff screen offers them. The screen's header still says that staff can send broadcast announcements, and its help text names a "Use" button that does not exist.
- Office admins cannot work on Utsav groups. The screen shows them the Utsav tab, but the backend refuses them the Utsav list and Utsav reminders.
- Read-only roles see "Connection Error" in the status badge, because the backend refuses them the connection status.
The member check
- The check falls back without a warning. When no group is recorded, or the WhatsApp service is disconnected, slow or fails, every expected person shows as missing. "Send Template Reminder to All Missing" then reminds people who already joined.
- The Extra list includes staff and volunteers who have no booking. It can also include the linked WhatsApp account's own number. "Remove all" queues their removal too.
- A member that WhatsApp shows without a phone number cannot be matched. That member shows as missing, and the group entry shows as extra.
- The check runs again before removals are likely done. It runs 1 second after the removals are queued, so removed people can still show as extra.
Reminders and links
- Reminders treat every number as an Indian number. A member abroad gets no reminder, or it goes to a wrong number.
- A reminder to one person usually greets them as "Mumukshu". The backend looks up the name with the number including its country code, so it does not find the card.
- Booking messages carry the group button even when no group link is set. The short link then shows "Link not found".
- Clearing the group link changes nothing. The short link still opens the old invite, and the old group stays recorded. When a changed link's lookup fails, the old group also stays recorded.
The WhatsApp service
- The status can be out of date. If the WhatsApp service stops, the screen keeps showing its last status, which can be "Connected".
- No one is told when the connection drops or a job fails. Jobs wait or fail without a message. Staff see a failed removal only when they run the check again.
- A job that was running when the service stopped never runs again. It stays in progress and is not retried.