Email Logs

An EmailLog is a record of the email notifications that were sent. This information is helpful for auditing your site's outbound emails.

Logs available through this endpoint are retained for 6 months, after which they are automatically discarded. For longer retention, use Files.com SIEM integrations to stream logs in real time to your preferred SIEM, or configure SIEM streaming to a file.

List Email Logs

SDK Method

emaillog.List()

Return Object

[]*EmailLog

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    email_log "github.com/Files-com/files-sdk-go/v3/emaillog"
)

emailLogIterator, err := email_log.List(files_sdk.EmailLogListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for emailLogIterator.Next() {
    emailLog := emailLogIterator.emailLog()
}
err = emailLogIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The EmailLog Object

Some of the methods above return a EmailLog object. The attributes of this object are listed below.

AttributeDescription
Timestamp
date-time
Start Time of Action. Deprecrated: Use created_at.
Message
string
Log Message
Status
string
Status of E-Mail delivery
Possible values: success, failure, suppressed
Subject
string
Subject line of E-Mail
To
string
To field of E-Mail
Cc
string
CC field of E-Mail
DeliveryMethod
string
How was the email delivered? customer_smtp or files.com
SmtpHostname
string
Customer SMTP Hostname used.
SmtpIp
string
Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP).
CreatedAt
date-time
Start Time of Action