Skip to main content

Knowledge > Runbooks > Customer Ops > Premium Page Setup

Manually Set Up a PewSearch Premium Page

Provision a Premium Page for a church when automated checkout fails, for manual deals (e.g., a founding church offer), or to correct an incomplete onboarding.

Prerequisites

  • Supabase access
  • Stripe CLI (if linking to a subscription)
  • Church's UUID from the churches table
  • Founder approval for any manual deal (no payment)

What a Premium Page Includes

A PewSearch Premium Page (plan: pro_website) gives a church:

  • An enhanced listing in the PewSearch directory
  • A hosted, branded church webpage (Pro Website)
  • Contact form submissions tracked in contact_submissions
  • Chatbot widget (if the organization_settings row is configured)
  • Admin dashboard access at pewsearch.com/admin/[token]

Steps

1. Verify the church exists in the churches table

SELECT id, name, slug, email, city, state, directory_visible
FROM churches
WHERE slug = '[church-slug]'
OR email ILIKE '%[email-fragment]%'
LIMIT 3;

If the church does not exist, create it first (rare — most churches already exist in the 218K+ import). Get founder approval before inserting.

2. Check for an existing premium_churches row

SELECT * FROM premium_churches WHERE church_id = '[church-uuid]';

If a row already exists, update it rather than inserting:

UPDATE premium_churches
SET plan = 'pro_website',
tier = 'chat',
stripe_subscription_id = '[sub_id or NULL]',
updated_at = now()
WHERE church_id = '[church-uuid]';

3. Insert a new premium_churches row (if none exists)

INSERT INTO premium_churches (
church_id,
plan,
tier,
stripe_subscription_id,
created_at,
updated_at
) VALUES (
'[church-uuid]',
'pro_website', -- plan
'chat', -- tier: chat | voice | both
'sub_xxxxxxxxxxxx', -- Stripe subscription ID, or NULL for manual/founder deals
now(),
now()
);

For manual deals with no Stripe subscription, set stripe_subscription_id = NULL and note it in the DECISION_LOG.md.

Insert a session so the church can access their dashboard:

INSERT INTO church_admin_sessions (church_id, token, created_at, expires_at)
VALUES (
'[church-uuid]',
gen_random_uuid()::text,
now(),
now() + interval '90 days'
);

Retrieve the token:

SELECT token FROM church_admin_sessions
WHERE church_id = '[church-uuid]'
ORDER BY created_at DESC LIMIT 1;

The admin URL is: https://pewsearch.com/admin/[token]

5. Configure the chatbot in organization_settings

If the church plan includes chatbot access:

INSERT INTO organization_settings (
church_id,
system_prompt,
is_active,
created_at
) VALUES (
'[church-uuid]',
'You are a friendly assistant for [Church Name]. Answer questions about service times, location, and how to get involved. Always be warm and welcoming.',
true,
now()
);

Adjust to match the current organization_settings schema:

SELECT column_name FROM information_schema.columns
WHERE table_name = 'organization_settings'
ORDER BY ordinal_position;

Email the church admin from john@churchwiseai.com with:

  • Their admin dashboard URL: https://pewsearch.com/admin/[token]
  • A brief explanation of what they can do in the dashboard
  • Contact info for support

7. Verify the setup end-to-end

  • Visit https://pewsearch.com/admin/[token] — dashboard should load with the church name and pro_website plan visible
  • Check that the church listing at https://pewsearch.com/churches/[slug] shows premium styling
  • If chatbot is configured, test the widget on their listing page

Verification

SELECT pc.plan, pc.tier, cas.token, cas.expires_at
FROM premium_churches pc
JOIN church_admin_sessions cas ON cas.church_id = pc.church_id
WHERE pc.church_id = '[church-uuid]'
ORDER BY cas.created_at DESC LIMIT 1;

Both rows should exist with correct values.

See Also