From 78580a6c6143b6f42c1da0494d690bdcfe602073 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Mon, 24 Feb 2025 13:32:50 +0530 Subject: [PATCH 1/6] adding a new param --- src/Plivo/Resource/Message/MessageInterface.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Plivo/Resource/Message/MessageInterface.cs b/src/Plivo/Resource/Message/MessageInterface.cs index 2fe0c8ac..80bd1f74 100755 --- a/src/Plivo/Resource/Message/MessageInterface.cs +++ b/src/Plivo/Resource/Message/MessageInterface.cs @@ -987,6 +987,12 @@ public class Parameter [JsonProperty("type")] public string Type { get; set; } + /// + /// Gets or sets the name of the parameter. + /// + [JsonProperty("parameter_name")] + public string ParameterName { get; set; } + /// /// Gets or sets the text value of the parameter. /// From 9c8f5db1efe168199aa60c7285d395491aa224a9 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Mon, 24 Feb 2025 22:20:54 +0530 Subject: [PATCH 2/6] add cahnge log --- CHANGELOG.md | 5 +++++ src/Plivo/Plivo.csproj | 2 +- src/Plivo/Version.cs | 2 +- version.json | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb511dc8..ca66d13e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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** diff --git a/src/Plivo/Plivo.csproj b/src/Plivo/Plivo.csproj index 90df7977..805b19dc 100644 --- a/src/Plivo/Plivo.csproj +++ b/src/Plivo/Plivo.csproj @@ -1,7 +1,7 @@ netstandard2.0;netstandard1.3 - 5.49.3 + 5.49.4 Plivo SDKs Team Plivo Inc. diff --git a/src/Plivo/Version.cs b/src/Plivo/Version.cs index 9cfed20b..2c4beb67 100644 --- a/src/Plivo/Version.cs +++ b/src/Plivo/Version.cs @@ -10,7 +10,7 @@ public class Version /// /// DotNet SDK version /// - public const string SdkVersion = "5.49.3"; + public const string SdkVersion = "5.49.4"; /// /// Plivo API version /// diff --git a/version.json b/version.json index 314e6e29..f13e1667 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "5.49.3", + "version": "5.49.4", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v\\d+(?:\\.\\d+)?$" From f34396621b1663ae85f00f85f731f6217c29e77d Mon Sep 17 00:00:00 2001 From: Vishnu Date: Tue, 25 Feb 2025 10:03:18 +0530 Subject: [PATCH 3/6] adding example in the readme --- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/README.md b/README.md index f731f3a7..4dd847c8 100644 --- a/README.md +++ b/README.md @@ -591,6 +591,76 @@ namespace PlivoExamples } ``` +#### Templated WhatsApp Messages With Named Parameter +This guide shows how to send templated and non-templated location messages with named parameters. + +Example: +```csharp +using System; +using System.Collections.Generic; +using Plivo; + +namespace PlivoExamples +{ + internal class Program + { + public static void Main(string[] args) + { + var api = new PlivoApi("",""); + + var template = new Template + { + Name = "plivo_order_pickup", + Language = "en_US", + Components = new List + { + new Component + { + Type = "header", + Parameters = new List + { + new Parameter + { + Type = "location", + ParameterName = "named_param_in_header", + Location = new Location + { + Longitude = "122.148981", + Latitude = "37.483307", + Name = "Pablo Morales", + Address = "1 Hacker Way, Menlo Park, CA 94025" + } + } + } + }, + new Component + { + Type = "body", + Parameters = new List + { + new Parameter + { + Type = "text", + Text = "Harry", + ParameterName = "named_param_in_body" + } + } + } + } + }; + + 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. From ee1286c662cf273e3f5d08f47b9678f7fbbd6d79 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Tue, 25 Feb 2025 10:05:34 +0530 Subject: [PATCH 4/6] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4dd847c8..f4b1a241 100644 --- a/README.md +++ b/README.md @@ -592,7 +592,7 @@ namespace PlivoExamples ``` #### Templated WhatsApp Messages With Named Parameter -This guide shows how to send templated and non-templated location messages with named parameters. +This guide shows how to send templated WhatsApp messages with named parameters. Example: ```csharp From f903451b5528ce989ead2d90a5532f078adde1c8 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Tue, 25 Feb 2025 10:09:38 +0530 Subject: [PATCH 5/6] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4b1a241..f859e69a 100644 --- a/README.md +++ b/README.md @@ -610,7 +610,7 @@ namespace PlivoExamples var template = new Template { - Name = "plivo_order_pickup", + Name = "plivo_order_pickup_named_param", Language = "en_US", Components = new List { From f51ea03a6d80a2732cad0352fbea17915f94b910 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Tue, 25 Feb 2025 12:39:55 +0530 Subject: [PATCH 6/6] fix readme --- README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f859e69a..0ae185c2 100644 --- a/README.md +++ b/README.md @@ -599,6 +599,7 @@ Example: using System; using System.Collections.Generic; using Plivo; +using Plivo.Resource.Message; namespace PlivoExamples { @@ -610,7 +611,7 @@ namespace PlivoExamples var template = new Template { - Name = "plivo_order_pickup_named_param", + Name = "template_name", Language = "en_US", Components = new List { @@ -621,15 +622,10 @@ namespace PlivoExamples { new Parameter { - Type = "location", - ParameterName = "named_param_in_header", - Location = new Location - { - Longitude = "122.148981", - Latitude = "37.483307", - Name = "Pablo Morales", - Address = "1 Hacker Way, Menlo Park, CA 94025" - } + Type = "text", + ParameterName = "header_title", + Text = "WA-header" + } } }, @@ -641,8 +637,8 @@ namespace PlivoExamples new Parameter { Type = "text", - Text = "Harry", - ParameterName = "named_param_in_body" + Text = "Saurabh", + ParameterName = "user_name" } } }