NeuCharFramework (NCF)
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • Basic Library Source Code Analysis
    • DynamicWebApiEngine
    • Deployment
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • NCF - NeuCharFramework
  • Projects

    • Preparation
    • Basic Library Source Code Analysis
    • DynamicWebApiEngine
    • Deployment
  • Help

    • Online Resources
    • Q&A Community
    • QQ Group (147054579)
    • Senparc WeChat SDK
  • Gitee
  • GitHub
  • English
  • 简体中文
GitHub
  • NCF Libraries

    • Senparc.Ncf.Core
    • Senparc.Ncf.Repository
    • Senparc.Ncf.Service
    • Senparc.Ncf.SMS
    • Senparc.Ncf.Mvc.UI
    • Senparc.Ncf.Log
    • Senparc.Ncf.Utility
    • Senparc.Ncf.XncfBase
    • Senparc.Ncf.AreaBase
    • Senparc.Ncf.DatabasePlant
  • Senparc.Ncf.AreaBase

    • IXncfRegister Interface

Senparc.Ncf.SMS

Overview

Senparc.Ncf.SMS is a module for sending SMS messages within the NeuCharFramework (NCF). This module provides a unified interface for various SMS service providers, making it easy to integrate and switch between different providers.

Installation

To install Senparc.Ncf.SMS, you can use the following command:

dotnet add package Senparc.Ncf.SMS

Configuration

In order to use Senparc.Ncf.SMS, you need to configure it in your application. Add the following code to your Startup.cs file:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSenparcNcfSMS(options =>
    {
        options.DefaultProvider = "YourDefaultProvider";
        options.AddProvider("YourProviderName", new YourProviderOptions
        {
            ApiKey = "YourApiKey",
            ApiSecret = "YourApiSecret"
        });
    });
}

Usage

After configuring the SMS module, you can use it to send SMS messages. Here is an example:

public class SmsService
{
    private readonly ISmsSender _smsSender;

    public SmsService(ISmsSender smsSender)
    {
        _smsSender = smsSender;
    }

    public async Task SendSmsAsync(string phoneNumber, string message)
    {
        await _smsSender.SendAsync(phoneNumber, message);
    }
}

Providers

Senparc.Ncf.SMS supports multiple SMS service providers. You can add and configure providers in the Startup.cs file as shown in the configuration section. Here are some of the supported providers:

  • Twilio
  • Nexmo
  • Alibaba Cloud

License

Senparc.Ncf.SMS is licensed under the MIT License. For more details, please refer to the LICENSE file.

Documentation

For more detailed documentation, please visit the official documentation.

Contributing

If you would like to contribute to Senparc.Ncf.SMS, please follow the guidelines in the CONTRIBUTING.md file.

Contact

For any questions or support, please contact us at support@senparc.com.

Change Log

For the latest updates and changes, please refer to the CHANGELOG.md file.

Edit this page on GitHub
Last Updated:
Contributors: Jeffrey Su
Prev
Senparc.Ncf.Service
Next
Senparc.Ncf.Mvc.UI