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
configurationIConfigurationenvironmentIWebHostEnvironmentlogILogger<LoggingSmsSender>
Properties
ConfigurationSummary
One line naming where messages go, or why they go nowhere. Safe to log.
public string ConfigurationSummary { get; }
Property Value
IsConfigured
Whether this deployment can deliver anything.
public bool IsConfigured { get; }
Property Value
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
toPhonestringbodystringcancellationTokenCancellationToken