You can develop your own integrations for sending SMS on the Xpoda Platform. Xpoda includes the "Message Center" integration by default. If you want to work with a different integrator, you can develop an Xpoda SMS Addon.
Xpoda SMS Addon should be developed as .NET Framework Class Library. It is recommended to select the .NET Framework version as 4.8. To develop the addon, it will be sufficient to create a Class Library type project and develop a library that satisfies the following conditions:
- Add an Interface of type ISmsProvider to your library.
// You should implement this interface in your project in class named "SmsProvider"
public interface ISmsProvider
{
string SendSms(string number, string content, string header, string username, string password);
}
- Add a class to your library that implements the ISmsProvider interface. Do not forget to specify the class qualifier as public. This class must contain a public and string return method named SendSms.
Example:
public class SmsProvider : ISmsProvider
{
public string SendSms(string number, string content, string header, string username, string password)
{
// Do actual implementation here
// Connect Sms gateway and relay sms
// Use arguments provided: number, content, header (Xpoda or your company name) , username, password.
return String.Format("tx id : {0}, input arguments: {1}, {2}, {3}, {4}, {5}", Guid.NewGuid().ToString(),
number,
content,
header,
username,
password);
}
}
The parameters of the SendSms method are number, content, header, username and password.
number |
Phone number to send
|
content |
SMS content
|
header |
The information shown in the sender section of the SMS. Example: XPODA or your company name
|
username |
Username field specified through Xpoda Client Admin that may be required to connect to the SMS service provider
|
password |
Password field, which is determined via Xpoda Client Admin and may be required to connect to the SMS service provider
|
- Compile your project. Copy the DLL file produced as output to the following folder under the Xpoda Service installation:
{XPODA_SERVICE_PATH}/Addition/Notifications/SMS
The image will look like this:
- After copying the DLL file of your library, you must select the specified addon from your Xpoda Client Admin panel.
- After choosing your library, you should make the following settings:
- Sms Header : Sender information to be shown in your sms. This variable will be sent to the header parameter in your SendSms method in the addon.
- Sms User : Username field that may be required to connect to the sms provider. This variable will be sent to the username parameter in your SendSms method in the addon.
- Sms Password: Password field that may be required to connect to the sms provider. This variable will be sent to the password parameter in your SendSms method in the addon.