Integrations
Matchpal integrates with external services to handle purchases and email delivery. This guide covers how these integrations work and how to manage them.
Integration Overview
Matchpal connects with:
| Service | Purpose |
|---|---|
| WooCommerce | Package purchases and order fulfillment |
| Resend | Email delivery and tracking |
WooCommerce Integration
WooCommerce handles the commerce side of Matchpal—allowing students to purchase tutoring and advising packages.
How It Works
- Student browses packages on WordPress/WooCommerce site
- Student completes purchase
- WooCommerce sends order data to Matchpal via webhook
- Matchpal creates grant for the student
- Student can begin matching process
Webhook Configuration
WooCommerce sends order notifications to Matchpal:
Webhook Events:
order.completed- Successful purchaseorder.refunded- Refund processed
Webhook URL: Configure in WooCommerce to point to your Matchpal instance:
https://your-matchpal-domain/api/webhooks/woocommerce
Product Mapping
Each WooCommerce product needs to map to a Matchpal package:
| WooCommerce Product | Matchpal Package | Hours |
|---|---|---|
| "5-Hour Tutoring" | tutoring_basic | 5 |
| "10-Hour Tutoring" | tutoring_standard | 10 |
| "Advising Bundle" | advising_package | 3 |
Order Processing
When an order arrives:
- Matchpal validates the webhook signature
- Looks up customer by email
- Creates or updates student account
- Identifies product(s) purchased
- Creates appropriate grant(s)
- Logs the fulfillment
Handling Failures
If order processing fails:
- Error logged in
order_fulfillment_errortable - Admin notified of failure
- Manual intervention may be required
Common failure reasons:
- Unknown product (no mapping configured)
- Invalid customer data
- Duplicate order processing
- Network/connectivity issues
See Order Errors for troubleshooting.
Testing the Integration
To verify WooCommerce connection:
- Create a test order in WooCommerce
- Check Matchpal for new grant
- Verify student account created/updated
- Review fulfillment logs
Resend Integration
Resend is the email delivery service that sends all Matchpal communications.
How It Works
- Matchpal composes email from template
- Sends to Resend API
- Resend delivers to recipient
- Resend sends status webhooks back to Matchpal
- Email logs updated with delivery status
API Configuration
Matchpal connects to Resend using:
- API Key - Authenticates requests
- Domain - Verified sending domain
- From Address - Default sender address
Webhook Events
Resend notifies Matchpal of email events:
| Event | Description |
|---|---|
email.sent | Email dispatched |
email.delivered | Delivery confirmed |
email.opened | Recipient opened |
email.clicked | Link clicked |
email.bounced | Delivery failed |
email.complained | Marked as spam |
Webhook URL
Configure in Resend dashboard:
https://your-matchpal-domain/api/webhooks/resend
Email Tracking
Through Resend webhooks, Matchpal tracks:
- Delivery success/failure
- Open rates
- Click-through rates
- Bounce reasons
Handling Bounces
When emails bounce:
- Resend sends bounce webhook
- Matchpal logs the failure
- Email status updated to "Bounced"
- Bounce reason recorded
For persistent bounces:
- Verify email address correct
- Contact recipient for alternative
- Consider removing invalid addresses
Testing the Integration
To verify Resend connection:
- Send a test email from Matchpal
- Check email logs for "Sent" status
- Verify email received
- Confirm status updates via webhooks
Managing Integrations
Viewing Integration Status
Check integration health:
- Navigate to Settings → Integrations
- See connection status for each service
- View recent activity
- Check error rates
Troubleshooting Connectivity
If integrations aren't working:
WooCommerce:
- Verify webhook URL is correct
- Check webhook secret matches
- Review WooCommerce webhook logs
- Test webhook delivery manually
Resend:
- Verify API key is valid
- Check sending domain is verified
- Review Resend dashboard for errors
- Test API connection
Security Considerations
API Keys:
- Store securely (environment variables)
- Rotate periodically
- Never commit to source control
Webhooks:
- Validate signatures
- Use HTTPS only
- Implement rate limiting
- Log all incoming requests
Adding New Integrations
Future integrations may include:
- Calendar systems (scheduling)
- Video conferencing (session delivery)
- Payment processors (direct billing)
- CRM systems (student management)
Contact your administrator about integration requirements.
Related Documentation
- Billing - How WooCommerce orders create grants
- Order Errors - WooCommerce troubleshooting
- Email System - How Resend delivers emails
- Email Failures - Email troubleshooting