コード例 #1
0
        public TextMessagingService(
            IOptions <TwilioSmsSettings> smsOptions,
            ILogger <TextMessagingService> logger)
        {
            _smsOptions = smsOptions?.Value ?? throw new ArgumentNullException(nameof(smsOptions));
            _logger     = logger ?? throw new ArgumentNullException(nameof(logger));

            var accountId = _smsOptions.AccountIdKey;

            var authToken = _smsOptions.AuthTokenKey;

            TwilioClient.Init(accountId, authToken);
        }
コード例 #2
0
 public HomeController(ILogger <HomeController> logger, IOptions <TwilioSmsSettings> twilioSmsSettings)
 {
     _logger            = logger;
     _twilioSmsSettings = twilioSmsSettings.Value;
 }