Send Email to All Members
Endpoint
Authentication
Requires JWT authentication token withadmin role.
Required Role: admin (only administrators can send to all members)
Request Body
Email subject line for the mass email
Email message body. Supports HTML formatting.Example:
Response Fields
Indicates whether the mass email operation was successful
Status message describing the result
Total number of members (socios) the email was sent to
Notes
- Admin Only: Only users with the
adminrole can use this endpoint - Target Audience: Sends emails to all users marked as members (socios) in the database
- HTML Support: The message body supports full HTML formatting
- Batch Processing: Emails are sent in batches to avoid overwhelming the SMTP server
- Error Handling: If some emails fail, the operation continues and reports statistics
- Database Query: Recipients are fetched from the
usuariostable wheresocio = 1 - Performance: For large member lists, this operation may take some time to complete
Best Practices
- Test First: Send a test email using
/mail/sendbefore sending to all members - HTML Validation: Ensure your HTML message is well-formed
- Subject Lines: Keep subject lines clear and concise (50-60 characters recommended)
- Timing: Consider sending mass emails during off-peak hours
- Content: Include unsubscribe information if required by local regulations
