notifyAdminOfUserRegistration
Send notification to admin when a new user registers. This is a public endpoint that can be called without authentication.Input Parameters
string
required
The name of the newly registered user
string
required
The email address of the newly registered user (must be valid email format)
Response
boolean
Indicates whether the notification was processed successfully
boolean
Indicates whether the WhatsApp notification was sent successfully
boolean
Indicates whether the email notification was sent successfully
array
Array of error messages if any notifications failed
Example
Partial Success Example
If one notification method fails, the response will indicate which succeeded:Complete Failure Example
Implementation Details
This endpoint uses the Mailgun service to send notifications. The implementation:- Accepts user registration details
- Attempts to send notifications via both WhatsApp and email channels
- Returns a detailed status for each notification method
- Continues execution even if one method fails (graceful degradation)
- Logs all errors for debugging purposes
Use Cases
- User Registration Flow: Automatically notify admins when new users sign up
- Approval Workflow: Alert admins to review and approve pending user accounts
- Audit Trail: Track when new users join the system