Table of Contents

Class LoggingSmsSender

Namespace
FishMMO.ControlPanel.Services
Assembly
FishMMO-ControlPanel.dll

The only SMS "provider" there is: it writes the message to the log.

public sealed class LoggingSmsSender : ISmsSender
Inheritance
LoggingSmsSender
Implements
Inherited Members

Remarks

No SMS gateway exists in this project yet. This sender is what lets the phone verification flow be exercised end to end on a development machine: the code shows up in the panel's log. It logs the body, which carries a verification code — acceptable here precisely because this is a development stand-in, and the reason it is not configured in Production unless an operator names it explicitly.

Configured when Sms:Provider is log, or — outside Production only — when no provider is named at all. In Production with no provider the drain logs once and idles, as the email drain does with no SMTP host, and queued messages wait for a real sender.

Constructors

LoggingSmsSender(IConfiguration, IWebHostEnvironment, ILogger<LoggingSmsSender>)

public LoggingSmsSender(IConfiguration configuration, IWebHostEnvironment environment, ILogger<LoggingSmsSender> log)

Parameters

configuration IConfiguration
environment IWebHostEnvironment
log ILogger<LoggingSmsSender>

Properties

ConfigurationSummary

One line naming where messages go, or why they go nowhere. Safe to log.

public string ConfigurationSummary { get; }

Property Value

string

IsConfigured

Whether this deployment can deliver anything.

public bool IsConfigured { get; }

Property Value

bool

Methods

SendAsync(string, string, CancellationToken)

Sends one message, returning whether it was accepted.

public Task<bool> SendAsync(string toPhone, string body, CancellationToken cancellationToken = default)

Parameters

toPhone string
body string
cancellationToken CancellationToken

Returns

Task<bool>