API Reference - Email Logs
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108099
← Back to API Reference | Getting Started
Email Logs
Email Logs record transactional emails sent from the platform, including admin-to-member emails, lead notifications, and system messages. Each record captures the full message, recipient, sender, and delivery status for audit and troubleshooting purposes.
email_log — DB table: email_logThe Email Log Object
| Field | Type | Description |
|---|---|---|
email_id | integer | Unique log record ID (primary key, read-only) |
subject | text | Subject line of the email |
to | string | Recipient email address |
message | text | Full HTML or plain-text body of the email |
date_sent | string | Date and time the email was sent (format: YYYYMMDDHHmmss) |
user_id | integer | ID of the member associated with this email; 0 if no member |
contact_id | integer | ID of the contact associated with this email; 0 if no contact |
type | string | Type of email (EG lead, system, admin) |
sent_by | string | Identifier of who or what triggered the send (EG an admin email address or system process name) |
lead_id | integer | ID of the related lead record; 0 if not lead-related |
status | text | Delivery status or provider response message |
List Email Log Records
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/email_log/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"email_id": "1",
"subject": "You have a new lead inquiry",
"to": "member@example.com",
"message": "You received a new lead from your listing.
",
"date_sent": "20240301143000",
"user_id": "42",
"contact_id": "0",
"type": "lead",
"sent_by": "system",
"lead_id": "17",
"status": "success"
}
],
"total": "500",
"current_page": 1,
"total_pages": 20,
"next_page": "MipfKjI1"
}Retrieve an Email Log Record
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/email_log/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"email_id": "1",
"subject": "You have a new lead inquiry",
"to": "member@example.com",
"message": "You received a new lead from your listing.
",
"date_sent": "20240301143000",
"user_id": "42",
"contact_id": "0",
"type": "lead",
"sent_by": "system",
"lead_id": "17",
"status": "success"
}
],
"total": "500",
"current_page": 1,
"total_pages": 1
}Create an Email Log Record
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/email_log/create" \ -H "X-Api-Key: your-api-key-here" \ -d "subject=New+lead+from+your+listing" \ -d "to=member%40example.com" \ -d "message=%3Cp%3EYou+have+a+new+lead.%3C%2Fp%3E" \ -d "date_sent=20240401120000" \ -d "user_id=42" \ -d "type=lead" \ -d "sent_by=system" \ -d "lead_id=18" \ -d "status=success"
Example Response
{
"status": "success",
"message": {
"email_id": "501",
"subject": "New lead from your listing",
"to": "member@example.com",
"message": "You have a new lead.
",
"date_sent": "20240401120000",
"user_id": "42",
"contact_id": null,
"type": "lead",
"sent_by": "system",
"lead_id": "18",
"status": "success"
}
}Update an Email Log Record
Example Request
curl -X PUT "https://www.yourdomain.com/api/v2/email_log/update" \ -H "X-Api-Key: your-api-key-here" \ -d "email_id=501" \ -d "status=bounced"
Example Response
{
"status": "success",
"message": {
"email_id": "501",
"to": "member@example.com",
"status": "bounced"
}
}Delete an Email Log Record
Example Request
curl -X DELETE "https://www.yourdomain.com/api/v2/email_log/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "email_id=501"
Example Response
{
"status": "success",
"message": "email_log record was deleted"
}