Skip to content

SMS-7359 : Adding paramater_name #294

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

Merged
merged 6 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Change Log

## [5.49.4](https://github.com/plivo/plivo-dotnet/tree/v5.49.4) (2025-02-25)
**Enhancement - Supporting parameter_name in WhatsApp Template .**
- Supporting parameter_name in WhatsApp Template .

## [5.49.3](https://github.com/plivo/plivo-dotnet/tree/v5.49.3) (2025-02-18)
**Feature - Throw PlivoGeoPermissionException on synchronous geopermissions error**

Expand Down
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,72 @@ namespace PlivoExamples
}
```

#### Templated WhatsApp Messages With Named Parameter
This guide shows how to send templated WhatsApp messages with named parameters.

Example:
```csharp
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Resource.Message;

namespace PlivoExamples
{
internal class Program
{
public static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>","<auth_token>");

var template = new Template
{
Name = "template_name",
Language = "en_US",
Components = new List<Component>
{
new Component
{
Type = "header",
Parameters = new List<Parameter>
{
new Parameter
{
Type = "text",
ParameterName = "header_title",
Text = "WA-header"

}
}
},
new Component
{
Type = "body",
Parameters = new List<Parameter>
{
new Parameter
{
Type = "text",
Text = "Saurabh",
ParameterName = "user_name"
}
}
}
}
};

var response = api.Message.Create(
src: "+14151112221",
dst: "+14151112222",
type: "whatsapp",
template: template);
Console.WriteLine(response);
}
}
}


```
### More examples
Refer to the [Plivo API Reference](https://api-reference.plivo.com/latest/net/introduction/overview) for more examples.

Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Plivo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard1.3</TargetFrameworks>
<ReleaseVersion>5.49.3</ReleaseVersion>
<ReleaseVersion>5.49.4</ReleaseVersion>
<Version />
<Authors>Plivo SDKs Team</Authors>
<Owners>Plivo Inc.</Owners>
Expand Down
6 changes: 6 additions & 0 deletions src/Plivo/Resource/Message/MessageInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,12 @@ public class Parameter
[JsonProperty("type")]
public string Type { get; set; }

/// <summary>
/// Gets or sets the name of the parameter.
/// </summary>
[JsonProperty("parameter_name")]
public string ParameterName { get; set; }

/// <summary>
/// Gets or sets the text value of the parameter.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Plivo/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Version
/// <summary>
/// DotNet SDK version
/// </summary>
public const string SdkVersion = "5.49.3";
public const string SdkVersion = "5.49.4";
/// <summary>
/// Plivo API version
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.49.3",
"version": "5.49.4",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
Expand Down
Loading