Azure / azure-notificationhubs-dotnet

.NET SDK for Azure Notification Hubs
MIT License
70 stars 119 forks source link

How do you choose the template when sending a notification? #213

Closed Qythyx closed 2 years ago

Qythyx commented 2 years ago

Query/Question My question is basically exactly the same as https://github.com/Azure/azure-notificationhubs-dotnet/issues/10. That was answered a number of years ago, but relies on the InstallationTemplate.Tags property. That property is now deprecated, so I'm wondering what the current way to do this is without using that deprecated property.

mpodwysocki commented 2 years ago

@Qythyx The way you choose a template is by sending it using a tag expression with the name of the template such as the following:

// Assumes you want to send using a named template "myTemplate" to a given installation ID
var tagExpression = "myTemplateName&&$InstallationId:12345";
Qythyx commented 2 years ago

@mpodwysocki, thanks for the response. This may be documented somewhere, but I read through a lot of the docs and didn't find it, so if there's an opportunity to improve the docs I recommend clarifying this.

mpodwysocki commented 2 years ago

@Qythyx agreed that it is not well documented and will put some work items in our backlog to further explain this.