Table of Contents

Class EmailQueueEntity

Namespace
FishMMO.Database.Npgsql.Entities
Assembly
FishMMO-DB.dll

Outbound email queue. Emails are inserted by the application layer and picked up by a background processor that delivers them via SMTP. Failed deliveries are retried up to a configurable maximum.

public class EmailQueueEntity : IVersionedEntity
Inheritance
EmailQueueEntity
Implements
Inherited Members

Properties

Attempts

Number of delivery attempts so far.

public int Attempts { get; set; }

Property Value

int

Body

Plain-text or HTML email body.

public string Body { get; set; }

Property Value

string

ClaimedAt

UTC timestamp when this email was claimed for delivery.

public DateTime? ClaimedAt { get; set; }

Property Value

DateTime?

ClaimedBy

Identifier of the LoginServer that claimed this email for delivery (server name).

public string? ClaimedBy { get; set; }

Property Value

string

CreatedAt

UTC timestamp when the email was enqueued.

public DateTime CreatedAt { get; set; }

Property Value

DateTime

ID

Primary key.

public long ID { get; set; }

Property Value

long

Kind

What this mail is for. Decides whether delivering it ends the account's unverified grace period; see EmailKind.

public EmailKind Kind { get; set; }

Property Value

EmailKind

Remarks

Defaults to Verification (0) in the database as well as here, so rows written before the column existed, and callers that do not name a kind, keep the meaning they already had.

LastError

Error message from the most recent failed delivery attempt, or null.

public string? LastError { get; set; }

Property Value

string

RecipientEmail

Recipient email address (max 320 chars).

[MaxLength(320)]
public string RecipientEmail { get; set; }

Property Value

string

RecipientUsername

Associated account username for logging and rate-limiting.

public string RecipientUsername { get; set; }

Property Value

string

RequestKey

The writer's once-per-request identity: a retry after a lost reply finds the row its first attempt wrote instead of writing a second one. Null for rows written without one.

public Guid? RequestKey { get; set; }

Property Value

Guid?

SentAt

UTC timestamp when the email was successfully sent, or null if still pending.

public DateTime? SentAt { get; set; }

Property Value

DateTime?

Subject

Email subject line (max 256 chars).

[MaxLength(256)]
public string Subject { get; set; }

Property Value

string

Version

Application-level concurrency token. Incremented on every write to detect stale updates.

public long Version { get; set; }

Property Value

long