DeleteInvalidEmails

public class DeleteInvalidEmails : SuppressionListDeleter<InvalidEmail>

The DeleteInvalidEmails.Delete class represents the API call to delete from the invalid email list. You can use it to delete the entire list, or specific entries on the list.

Delete All Invalid Emails

To delete all invalid emails, use the request returned from DeleteInvalidEmails.all. This request will delete all addresses on your invalid email list.

do {
    let request = DeleteInvalidEmails.all
    try Session.shared.send(request: request) { result in
        switch result {
        case .success(let response):
            print(response.statusCode)
        case .failure(let err):
            print(err)
        }
    }
} catch {
    print(error)
}

Delete Specific Invalid Emails

To delete specific entries from your invalid email list, use the DeleteInvalidEmails class. You can either specify email addresses (as strings), or you can use InvalidEmail instances (useful for if you just retrieved some from the RetrieveInvalidEmails class).

do {
    let request = DeleteInvalidEmails(emails: "foo@example", "bar@example")
    try Session.shared.send(request: request) { result in
        switch result {
        case .success(let response):
            print(response.statusCode)
        case .failure(let err):
            print(err)
        }
    }
} catch {
    print(error)
}
  • all

    Returns a request that will delete all the entries on your spam report list.

    Declaration

    Swift

    public static var all: DeleteInvalidEmails { get }