Reputation: 3032
We can add multiple email sender's addresses after configuring custom domain (https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/add-multiple-senders):
Now, I want to do it programmatically with some of the SDKs. Is there any possibilities to do that?
Upvotes: 0
Views: 614
Reputation: 3032
I found examples here: https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/add-multiple-senders-mgmt-sdks?pivots=programming-language-csharp
string subscriptionId = "";
string resourceGroupName = "";
string emailServiceName = "";
string domainName = "";
string emailAddressToAdd = "no-replay";
ArmClient client = new(new DefaultAzureCredential());
ResourceIdentifier senderUsernameResourceId = SenderUsernameResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, emailServiceName, domainName, emailAddressToAdd);
SenderUsernameResource senderUsernameResource = client.GetSenderUsernameResource(senderUsernameResourceId);
SenderUsernameResourceData data = new()
{
Username = emailAddressToAdd,
DisplayName = "No Replay",
};
senderUsernameResource.Update(WaitUntil.Completed, data);
Upvotes: 0