Table of Contents

Class UserMailEntity

Namespace
Tharga.Team.MongoDB
Assembly
Tharga.Team.MongoDB.dll

One queued mail to a user and where it stands.

public record UserMailEntity : EntityBase, ISupportInitialize, IEquatable<PersistableEntityBase>, IEntity<ObjectId>, IEquatable<EntityBase<ObjectId>>, IEquatable<EntityBase>, IEquatable<UserMailEntity>
Inheritance
PersistableEntityBase
EntityBase<ObjectId>
EntityBase
UserMailEntity
Implements
IEquatable<PersistableEntityBase>
IEntity<ObjectId>
IEquatable<EntityBase<ObjectId>>
IEquatable<EntityBase>
Inherited Members
EntityBase.ToString()
EntityBase.GetHashCode()
EntityBase.Equals(EntityBase<ObjectId>)
EntityBase.Equals(EntityBase)
EntityBase.<Clone>$()
EntityBase.EqualityContract
EntityBase<ObjectId>.Equals(PersistableEntityBase)
EntityBase<ObjectId>.Id
PersistableEntityBase.NeedsCleaning()
PersistableEntityBase.BeginInit()
PersistableEntityBase.EndInit()
PersistableEntityBase.CatchAll

Properties

Attachments

The files; always an array, so their content can be removed in one update once the mail is done.

public UserMailAttachmentEntity[] Attachments { get; init; }

Property Value

UserMailAttachmentEntity[]

Attempts

How many times it has been claimed for sending.

public int Attempts { get; init; }

Property Value

int

BatchId

The batch whose content the mail carries, or null for a mail queued on its own.

[BsonIgnoreIfNull]
public string BatchId { get; init; }

Property Value

string

Body

The plain-text body.

public string Body { get; init; }

Property Value

string

BodyHtml

The sanitized HTML body, or null for a text-only mail.

[BsonIgnoreIfNull]
public string BodyHtml { get; init; }

Property Value

string

BouncedAt

When the report that it bounced was read, in UTC.

[BsonIgnoreIfNull]
public DateTime? BouncedAt { get; init; }

Property Value

DateTime?

Category

The category's key.

public required string Category { get; init; }

Property Value

string

ClaimedBy

Who holds it, while a sender does.

[BsonIgnoreIfNull]
public string ClaimedBy { get; init; }

Property Value

string

ClaimedUntil

When the holder's lease runs out, in UTC.

[BsonIgnoreIfNull]
public DateTime? ClaimedUntil { get; init; }

Property Value

DateTime?

CompletedAt

When it was sent, skipped or given up, in UTC; the retention period runs from here.

[BsonIgnoreIfNull]
public DateTime? CompletedAt { get; init; }

Property Value

DateTime?

DeduplicationKey

The deduplication key, unique where present.

[BsonIgnoreIfNull]
public string DeduplicationKey { get; init; }

Property Value

string

Kind

Which kind of mail it is, stored by name; null on a mail stored before kinds were, read as a message when it names a batch and as a mail otherwise.

[BsonIgnoreIfNull]
[BsonRepresentation(BsonType.String)]
public UserMailKind? Kind { get; init; }

Property Value

UserMailKind?

MessageId

The Message-ID it was sent with, which a bounce report names it by.

[BsonIgnoreIfNull]
public string MessageId { get; init; }

Property Value

string

NextAttemptAt

When it is next due, in UTC.

public DateTime NextAttemptAt { get; init; }

Property Value

DateTime

QueuedAt

When it was queued, in UTC.

public DateTime QueuedAt { get; init; }

Property Value

DateTime

Reason

Why it was skipped, failed or bounced, or why the last attempt did not succeed.

[BsonIgnoreIfNull]
public string Reason { get; init; }

Property Value

string

RecipientAddress

The address the mail is or was addressed to: the one it was queued with, or for a mail to a user the one on their record when it was sent, in lower case.

[BsonIgnoreIfNull]
public string RecipientAddress { get; init; }

Property Value

string

RecipientName

The name a mail queued to an address alone is addressed to.

[BsonIgnoreIfNull]
public string RecipientName { get; init; }

Property Value

string

RecipientUserKey

The key of the user the mail is for; null for a mail queued to an address alone.

public string RecipientUserKey { get; init; }

Property Value

string

Refused

Whether this records a mail the queue refused, which the mail log shows and a user's own history does not.

[BsonIgnoreIfDefault]
public bool Refused { get; init; }

Property Value

bool

ReplyTo

The reply address the mail was queued with, or null.

[BsonIgnoreIfNull]
public string ReplyTo { get; init; }

Property Value

string

Status

Where the mail stands, stored by name.

[BsonRepresentation(BsonType.String)]
public UserMailStatus Status { get; init; }

Property Value

UserMailStatus

Subject

The subject line.

public required string Subject { get; init; }

Property Value

string

TeamKey

The key of the team the mail is about, or null when it belongs to none or to several.

[BsonIgnoreIfNull]
public string TeamKey { get; init; }

Property Value

string