The Loops integration has been fully updated to sync nominees, nominators, and voters with appropriate user groups and events. This provides comprehensive email marketing automation for the World Staffing Awards 2026.
- Who: Approved nominees (people and companies)
- When: Synced when nomination is approved by admin
- Requirements: Must have email address
- Source: "WSA 2026 Nominations"
- Who: People who submit nominations
- When: Synced immediately when nomination is submitted
- Requirements: Email is required for nomination form
- Source: "WSA 2026 Nominations"
- Who: People who vote for nominees
- When: Synced when vote is cast
- Requirements: Email is required for voting
- Source: "WSA 2026 Voting"
// Sync nominee (on approval)
await loopsService.syncNominee({
email: 'nominee@example.com',
name: 'John Doe',
category: 'Top Recruiter',
type: 'person',
linkedin: 'https://linkedin.com/in/johndoe'
});
// Sync nominator (on submission)
await loopsService.syncNominator({
email: 'nominator@example.com',
name: 'Jane Smith',
phone: '+1234567890',
linkedin: 'https://linkedin.com/in/janesmith'
});
// Sync voter (on vote)
await loopsService.syncVoter({
email: 'voter@example.com',
firstName: 'Bob',
lastName: 'Johnson'
});// Nomination submitted event
await loopsService.sendNominationEvent(
{ email: 'nominator@example.com' },
{
category: 'Top Recruiter',
nomineeId: 'uuid-123',
nomineeName: 'John Doe',
nomineeType: 'person'
}
);
// Nomination approved event
await loopsService.sendNominationApprovedEvent(
{ email: 'nominee@example.com' },
{
category: 'Top Recruiter',
nomineeId: 'uuid-123',
nomineeName: 'John Doe',
liveUrl: '/nominee/john-doe'
}
);
// Vote cast event
await loopsService.sendVoteEvent(
{ email: 'voter@example.com' },
{
category: 'Top Recruiter',
nomineeId: 'uuid-123',
nomineeSlug: 'john-doe',
nomineeName: 'John Doe'
}
);File: src/app/api/nominations/route.ts
When a nomination is submitted:
- ✅ Nominator is synced to "Nominator 2026" group
- ✅ "nomination_submitted" event is sent to nominator
- ✅ Non-blocking async execution (doesn't delay response)
File: src/app/api/nominations/route.ts (PATCH method)
When a nomination is approved:
- ✅ Nominee is synced to "Nominees 2026" group (if email provided)
- ✅ "nomination_approved" event is sent to nominee
- ✅ Non-blocking async execution
File: src/app/api/votes/route.ts (existing)
When a vote is cast:
- ✅ Voter is synced to "Voter 2026" group
- ✅ "vote_cast" event is sent to voter
- All Loops sync operations are wrapped in try-catch blocks
- Failures are logged but don't block the main operation
- Uses fire-and-forget pattern with setTimeout for non-critical syncs
- Nominee sync only occurs if email is provided
- Graceful skipping with logging when email is missing
- All other syncs require email (enforced by form validation)
- Built-in retry mechanism with exponential backoff
- Maximum 3 retry attempts
- Handles network timeouts and API errors
Endpoint: /api/dev/loops-test
Available test actions:
# Test nominee sync
POST /api/dev/loops-test
{
"action": "sync-nominee",
"email": "nominee@example.com",
"name": "Jane Nominee",
"category": "Top Recruiter",
"type": "person"
}
# Test nominator sync
POST /api/dev/loops-test
{
"action": "sync-nominator",
"email": "nominator@example.com",
"name": "Bob Nominator"
}
# Test voter sync
POST /api/dev/loops-test
{
"action": "sync-voter",
"email": "voter@example.com",
"firstName": "Alice",
"lastName": "Voter"
}
# Test events
POST /api/dev/loops-test
{
"action": "send-nomination-event",
"email": "nominator@example.com",
"category": "Top Recruiter",
"type": "person"
}GET /api/dev/loops-testReturns:
- Loops enabled status
- API key configuration status
- Available test endpoints
- User group mappings
LOOPS_API_KEY=your_loops_api_key_hereLOOPS_SYNC_ENABLED=true # Set to 'false' to disable- User submits nomination → Form validation
- Nomination saved → Database storage
- Nominator synced → Loops "Nominator 2026" group
- Event sent → "nomination_submitted" event
- Admin approves → Status updated to "approved"
- Nominee synced → Loops "Nominees 2026" group (if email available)
- Event sent → "nomination_approved" event
- User casts vote → Vote validation
- Vote saved → Database storage
- Voter synced → Loops "Voter 2026" group
- Event sent → "vote_cast" event
email(required)firstName(parsed from name)lastName(parsed from name)userGroup(Nominees 2026 | Nominator 2026 | Voter 2026)source(WSA 2026 Nominations | WSA 2026 Voting)
All events include:
year: '2026'category(award category)source(WSA 2026 Nominations | WSA 2026 Voting)- Event-specific properties (nominee details, vote details, etc.)
- Segmented email lists by user type
- Automated follow-up sequences
- Event-triggered campaigns
- Track engagement by user group
- Monitor nomination and voting patterns
- Measure campaign effectiveness
- Personalized communications
- Relevant content delivery
- Timely notifications
All Loops integration features are fully implemented and tested:
- ✅ Three user groups properly configured
- ✅ Contact sync for all user types
- ✅ Event tracking for key actions
- ✅ Error handling and validation
- ✅ Development testing tools
- ✅ Non-blocking async execution
- ✅ Comprehensive documentation
The system is ready for production use with Loops email marketing automation.