Table of Contents

Method AddMailBodyCleanupAgent

Namespace
MailFathom.AI
Assembly
MailFathom.AI.dll

AddMailBodyCleanupAgent(IServiceCollection, bool)

Registers the one way a reduced body becomes the cleaned rendering, in whichever of its two states the deployment is in.

public static IServiceCollection AddMailBodyCleanupAgent(this IServiceCollection services, bool isActivated)

Parameters

services IServiceCollection

The service collection to add to.

isActivated bool

Whether the deployment declared a chat endpoint, which is the whole of what this pass needs: which readers want the rendering is their own preference rather than an operator's key.

Returns

IServiceCollection

The same service collection, so registration reads as one expression.

Remarks

Registered on the same terms as enrichment and a conversation's state: the port answers with a reason rather than with an absence, so the reading pane draws the uncleaned message and says why instead of drawing an empty pane.

Which of the two is registered is decided once, at composition, so an instance that did not ask for this never resolves a chat client and never composes a turn out of somebody's mail. The use case is registered in both states rather than only the active one, because the route answers the same shape either way.

Scoped when it is active, because one open is one proposal: the ledger the call is charged to, the credential it resolves, and the transport it opens all belong to that request. The inactive one is a singleton holding nothing.

Exceptions

ArgumentNullException

Thrown when services is null.