Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Azure Communication SMS #15539

Merged
merged 34 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d98c12e
Suuport Azure Communication SMS
hishamco Mar 18, 2024
588a0fb
PackageManagement -> PackageVersion
hishamco Sep 13, 2024
2c7bf82
Update the APIs
hishamco Sep 13, 2024
e358db4
Remove module to module dependency
hishamco Sep 13, 2024
d017784
Merge branch 'main' into hishamco/azure-sms
hishamco Sep 13, 2024
955acae
Add project reference
hishamco Sep 13, 2024
1b91442
Add unit test
hishamco Sep 13, 2024
19824f2
Apply suggestions from code review
hishamco Sep 14, 2024
38aba4f
Enhancements
hishamco Sep 14, 2024
693951d
Use SmsResult
hishamco Sep 14, 2024
4dd1256
Fix broken unit test
hishamco Sep 14, 2024
f6559c9
Apply suggestions from code review
hishamco Sep 14, 2024
50df9f5
Fix the build
hishamco Sep 14, 2024
b9abd64
Revert unnecessary changes
hishamco Sep 14, 2024
1c9fd3e
Move SmsPermissions to OC.Sms.Core
hishamco Sep 14, 2024
e208e0c
Address feedback
hishamco Sep 14, 2024
e7d0088
Finalize updates
MikeAlhayek Sep 14, 2024
f482e34
Fix build, improve docs, and fix the default provider
MikeAlhayek Sep 14, 2024
2205984
Fix the UI
MikeAlhayek Sep 14, 2024
fddf697
Updates
hishamco Sep 15, 2024
2f3d045
Update AzureSettingsDisplayDriver.cs
MikeAlhayek Sep 15, 2024
c88451a
Update README.md
MikeAlhayek Sep 15, 2024
11270da
Update 2.1.0.md
MikeAlhayek Sep 15, 2024
3b84c60
Update Manifest.cs
MikeAlhayek Sep 15, 2024
12e06c3
update
MikeAlhayek Sep 15, 2024
93a2dad
Update docs
hishamco Sep 15, 2024
652f93a
Add SMS provider in navigation
hishamco Sep 15, 2024
6b59682
Apply suggestions from code review
hishamco Sep 15, 2024
a63d5f3
Refer to docs in release note
hishamco Sep 15, 2024
3b7d00a
Apply suggestions from code review
hishamco Sep 15, 2024
c6523d5
Apply suggestions from code review
hishamco Sep 15, 2024
1826653
Update AzureSmsProviderBase.cs
MikeAlhayek Sep 15, 2024
124231f
Add docs
hishamco Sep 15, 2024
8b627ca
fix docs
MikeAlhayek Sep 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public abstract class AzureSmsProviderBase : ISmsProvider
private readonly IPhoneFormatValidator _phoneFormatValidator;
private readonly ILogger _logger;

private SmsClient _smsClient;

protected readonly IStringLocalizer S;

public AzureSmsProviderBase(
Expand Down Expand Up @@ -55,8 +57,9 @@ public virtual async Task<SmsResult> SendAsync(SmsMessage message)

try
{
var client = new SmsClient(_providerOptions.ConnectionString);
var response = await client.SendAsync(_providerOptions.PhoneNumber, message.To, message.Body);
_smsClient ??= new SmsClient(_providerOptions.ConnectionString);

var response = await _smsClient.SendAsync(_providerOptions.PhoneNumber, message.To, message.Body);

if (response.Value.Successful)
{
Expand Down
4 changes: 2 additions & 2 deletions src/docs/reference/modules/Sms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Enabling the `SMS` feature will add a new settings page under `Configurations` >
!!! note
After enabling the SMS feature, you must configure the default provider in order to send SMS messages.

## Configuring Twilio Provider
## Configuring the Twilio Providers

To enable the [Twilio](https://www.twilio.com) provider, navigate to `Configurations` >> `Settings` >> `SMS`. Click on the `Twilio` tab, click the Enable checkbox and provider your Twilio account info. Then in the `Providers` tab, select Twilio as your default provider.

## Azure Communication SMS Provider
## Configuring the Azure Communication SMS Providers

To enable the [Azure Communication SMS](https://learn.microsoft.com/en-us/azure/communication-services/overview) providers, you'll need to enable the **Azure Communication SMS** feature. The navigate to `Configurations` >> `Settings` >> `SMS`. Click on the `Azure Communication SMS` tab, click the Enable checkbox and provider your Azure Communication SMS account info. Then in the `Providers` tab, select one of the 'Azure Communication SMS' as your default provider.

Expand Down