Skip to content

Commit

Permalink
Merge pull request #67 from cmdotcom/feature/WhatappProductMessages
Browse files Browse the repository at this point in the history
Feature/whatsapp product messages
  • Loading branch information
Mohammed-Kamal-CM authored Jul 3, 2023
2 parents 10ab519 + bad7504 commit 46d83e8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.7.0] - 2023-06-26
### Added
- Whatsapp Multi-Product Template Messages

## [2.6.0] - 2022-12-07
### Added
- System.Text.Json, replaces Newtsonsoft, possibly breaking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ public class InteractiveAction
/// </summary>
[JsonPropertyName("sections")]
public InteractiveSection[] Sections { get; set; }
/// <summary>
/// Source: https://developers.facebook.com/docs/whatsapp/on-premises/reference/messages#action-object
/// Product’s unique identifier
/// Required for Single-Product Messages and Multi-Product Messages.
/// </summary>
[JsonPropertyName("product_retailer_id")]
public string ProductRetailerId { get; set; }
/// <summary>
/// Source: https://developers.facebook.com/docs/whatsapp/on-premises/reference/messages#action-object
/// Unique identifier of the Facebook catalog linked to your WhatsApp Business
/// Required for Single-Product Messages and Multi-Product Messages.
/// </summary>
[JsonPropertyName("catalog_id")]
public string CatalogId { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -223,6 +237,13 @@ public class InteractiveSection
/// </summary>
[JsonPropertyName("rows")]
public Rows[] Rows { get; set; }
/// <summary>
/// Source: https://developers.facebook.com/docs/whatsapp/on-premises/reference/messages#action-object
/// Array of product objects. There is a minimum of 1 product per section and a maximum of 30 products across all sections.
/// Required for Multi-Product Messages.
/// </summary>
[JsonPropertyName("product_items")]
public WhatsAppProduct[] ProductItems { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -250,4 +271,17 @@ public class Rows
[JsonPropertyName("description")]
public string Description { get; set; }
}

/// <summary>
/// https://developers.facebook.com/docs/whatsapp/on-premises/reference/messages#action-object
/// Required for Multi-Product Messages.
/// </summary>
public class WhatsAppProduct
{
/// <summary>
/// Unique identifier of the product in a catalog
/// </summary>
[JsonPropertyName("product_retailer_id")]
public string ProductRetailerId { get; set; }
}
}
6 changes: 3 additions & 3 deletions CM.Text/CM.Text.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageIcon>icon.png</PackageIcon>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../CHANGELOG.md"))</PackageReleaseNotes>
<Version>2.6.0</Version>
<Version>2.7.0</Version>
<PackageProjectUrl>https://github.com/cmdotcom/text-sdk-dotnet</PackageProjectUrl>
<NeutralLanguage>en</NeutralLanguage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyVersion>2.6.0</AssemblyVersion>
<FileVersion>2.6.0</FileVersion>
<AssemblyVersion>2.7.0</AssemblyVersion>
<FileVersion>2.7.0</FileVersion>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down

0 comments on commit 46d83e8

Please sign in to comment.