Skip to content

Commit

Permalink
Send Video Attachment Template message implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldwight committed Nov 3, 2022
1 parent f7d40eb commit e131399
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
10 changes: 9 additions & 1 deletion WhatsappBusiness.CloudApi/Interfaces/IWhatsAppBusinessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,15 @@ public interface IWhatsAppBusinessClient
/// <summary>
/// Send Video Message by Template
/// </summary>
/// <param name="videoMessage">VideoTemplateMessageRequest object</param>
/// <param name="videoTemplateMessageRequest">VideoTemplateMessageRequest object</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>WhatsAppResponse</returns>
WhatsAppResponse SendVideoAttachmentTemplateMessage(VideoTemplateMessageRequest videoTemplateMessageRequest, CancellationToken cancellationToken = default);

/// <summary>
/// Send Video Message by Template
/// </summary>
/// <param name="videoTemplateMessageRequest">VideoTemplateMessageRequest object</param>
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>WhatsAppResponse</returns>
Task<WhatsAppResponse> SendVideoAttachmentTemplateMessageAsync(VideoTemplateMessageRequest videoTemplateMessageRequest, CancellationToken cancellationToken = default);
Expand Down
12 changes: 12 additions & 0 deletions WhatsappBusiness.CloudApi/WhatsAppBusinessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,18 @@ public async Task<WhatsAppResponse> SendVideoAttachmentMessageByIdAsync(VideoMes
return await WhatsAppBusinessPostAsync<WhatsAppResponse>(videoMessage, formattedWhatsAppEndpoint, cancellationToken);
}

/// <summary>
/// Send Video Template Message
/// </summary>
/// <param name="videoTemplateMessageRequest"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public WhatsAppResponse SendVideoAttachmentTemplateMessage(VideoTemplateMessageRequest videoTemplateMessageRequest, CancellationToken cancellationToken = default)
{
var formattedWhatsAppEndpoint = WhatsAppBusinessRequestEndpoint.SendMessage.Replace("{{Phone-Number-ID}}", _whatsAppConfig.WhatsAppBusinessPhoneNumberId);
return WhatsAppBusinessPostAsync<WhatsAppResponse>(videoTemplateMessageRequest, formattedWhatsAppEndpoint, cancellationToken).GetAwaiter().GetResult();
}

/// <summary>
/// Send Video Template Message
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/gabrieldwight/Whatsapp-Business-Cloud-Api-Net</RepositoryUrl>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Version>1.0.10</Version>
<Version>1.0.11</Version>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netstandard2.0'">
Expand Down

0 comments on commit e131399

Please sign in to comment.