Deploy Mass Intention Schedule Calendar
Mass Intention Calendar — Installation Guide
A public-facing calendar page that shows only Mass events, color-coded by intention status: **green** means no registered participants (a Mass Intention is available), **red** means one or more registered participants (an intention has been reserved). Clicking an event opens a details popup with a button that links to the event details page.
Built on the MinistryPlatform Custom Widget framework and the community FullCalendar widget.
What you need before starting
You will need SQL Server Management Studio access to the MinistryPlatform database, edit access to the church website, and the two files that ship with this guide: deploy_MassIntentionCalendar.sql and mass-intention-calendar-embed.html.
The stored procedure identifies Masses by Event Type. On this system the "Mass" event type is ID **13** — verify yours on the Event Types page in the Platform and adjust the `Event_Type_ID = 13` line in the SQL if it differs.
If you do not have a dedicated hosting plan or don't have the required SQL Server skills, reach out to the professional services team for assistance. Normal hourly rates will apply.
Step 1 — Run the database script
Open `deploy_MassIntentionCalendar.sql` in SSMS, make sure you are connected to the **MinistryPlatform database** (not master — check the database dropdown), and execute it. The script does three things, all required:
1. Creates the stored procedure `dbo.api_custom_MassIntentionCalendar_JSON`, which returns Mass events in a date range with a registrant count per event.
2. Registers the procedure in `dp_API_Procedures` so the MinistryPlatform API is allowed to call it.
3. Links the procedure to the **Administrators** security role in `dp_Role_API_Procedures`. This step is easy to miss and the widget will not work without it — the API checks role links, not SQL permissions.
The script ends with three verification queries. All three must return a row ("Proc exists", "API registered", "Role linked"). It is safe to re-run the script; it will not create duplicates.
Step 2 — Verify the API can reach the procedure
In a browser, open (replace `yourchurch` with your MP host prefix):
```
https://yourchurch.cloudapps.ministryplatform.cloud/sky/api/CustomWidget?storedProcedure=api_custom_MassIntentionCalendar_JSON
```
You should see JSON containing your Mass events. If instead you see *"Procedure ... does not exists or user does not have access to it"*, see Troubleshooting below.
Step 3 — Add the calendar page to the website
Create a new page on the website and add an HTML embed containing the full contents of `mass-intention-calendar-embed.html`. All the settings an administrator normally touches live in one place: the **`MASS_CAL_CONFIG` block at the very top of the file**. You should not need to hunt through the rest of the code. Edit these three values:
- congregationIDs — which parish(es) this page shows. Set it to "" for all congregations, "5" for a single parish, or "5,8,12" for a cluster. Use the numeric Congregation_ID(s) from the Congregations page in the Platform.
- dataHost — your MP host prefix (the part of your Platform URL before `.ministryplatform.net`), e.g. `"catholicdemo"`.
- eventDetailsPage — the page the popup button links to, with everything up to the event ID; the Event_ID is appended automatically.
The block includes commented examples for each. A fourth advanced setting, searchMonthsAhead, controls how far the "Find Next Available Mass" button looks; it rarely needs changing. The embed is otherwise fully self-contained: widget container, the two required script libraries, the calendar logic, the details popup (modal), and all styling including the color legend.
Because each page can point at a different `congregationIDs` value, one instance can serve a separate page per parish (each showing only its own Masses) as well as a combined page for a cluster of parishes — all from the same stored procedure.
Step 4 — Test
Open the new page. You should see a month calendar showing only Masses, green and red per the legend, with white bold text on the event chips. Click a green Mass: the popup should say no intention is scheduled and show a green "Request this Mass Intention" button. Click a red Mass: the popup should say an intention is scheduled and show a red "Event Details" button. Both buttons open the details page in the same window.
Troubleshooting
**"Procedure ... does not exists or user 'apiuser' does not have access to it."**
This message comes from the MinistryPlatform API, not SQL Server, and almost always means a missed registration step rather than a SQL permission problem. Check in order: the proc exists in the right database and in the `dbo` schema (`SELECT SCHEMA_NAME(schema_id), name FROM sys.procedures WHERE name LIKE 'api_custom%'`); a row exists in `dp_API_Procedures` with the exact name, no typos or trailing spaces (`SELECT QUOTENAME(Procedure_Name), LEN(Procedure_Name) FROM dp_API_Procedures` — expect length 37); and a row links it to a role in `dp_Role_API_Procedures`. The deploy script's verification queries check all three.
**Calendar page shows only the legend, no calendar.**
The widget's data call is failing, so the widget never renders. Open the browser console (F12) and reload — the widget logs its calls when `data-debug="true"`. Usually this is the same API error above, or a wrong `data-host` value.
**Calendar renders but no events appear.**
The procedure filters to approved, web-approved, public-visibility, non-cancelled Masses. Confirm your Mass events have Event Type "Mass" (ID 13 here), are approved for the web, and have Public visibility — or relax those filters in the stored procedure (they are commented).
**A Mass shows green but should be red (or vice versa).**
The registrant count includes participation statuses Registered, Attended, and Confirmed only. Interested, Cancelled, Abandoned, and Awaiting Payment do not count. Adjust the `Participation_Status_ID IN (2, 3, 4)` line if your parish uses different conventions.
**Changes to API registration don't take effect.**
The API may cache its procedure list. Recycle the MinistryPlatform API application pool in IIS (the app under the site at `/ministryplatformapi`) or wait for the scheduled recycle.
Customization notes
Colors are defined in two places in the embed: the `COLOR_AVAILABLE`/`COLOR_RESERVED` constants in the script (event chips) and the matching hex values in the `<style>` block (legend and popup buttons). Change both to re-theme. The date window defaults to the visible calendar range; the stored procedure defaults to 60 days out if called with no dates.
MinistryPlatform Configuration
Event Types - Verify that you have an Event Type for Mass. Create it if necessary.
Program - Verify that you have a program in place for handling Mass Intention payments. Your Mass events should use this program. If you also have MP eGiving, ensure that you have a Fund for Mass Intention and that it is linked to the correct program and is configured for payment (rather than giving).
Online Registration Product - Verify that you have an Online Registration Product and that the pricing information is correct. Create it if necessary. Your Mass events should use this.
Online Registration Form - Verify that you have an Online Registration Form and that the questions are appropriate.. Create it if necessary. Your Mass events should use this.