Skip to content

Commit

Permalink
Adding payload parameter in whatsapp templates (#237)
Browse files Browse the repository at this point in the history
* Adding payload parameter in whatsapp templates
  • Loading branch information
saurabhnewatiya-plivo authored Apr 18, 2024
1 parent 39c1186 commit a3a72a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [4.56.0](https://github.com/plivo/plivo-ruby/tree/v4.56.0) (2023-04-18)
**Feature - Support for dynamic button components when sending a templated WhatsApp message**
- Added new param `payload` in templates to support dynamic payload in templates

## [4.55.2](https://github.com/plivo/plivo-ruby/tree/v4.55.2) (2024-02-28)
**Feature - Log Redaction Enhancement**
- Added log attribute in GET and List MDR response
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
Add this line to your application's Gemfile:

```ruby
gem 'plivo', '>= 4.55.2'
gem 'plivo', '>= 4.56.0'
```

And then execute:
Expand Down
6 changes: 4 additions & 2 deletions lib/plivo/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ def to_hash
end

class Parameter
attr_accessor :type, :text, :media, :currency, :date_time
attr_accessor :type, :text, :media, :payload, :currency, :date_time

def initialize(type: nil, text: nil, media: nil, currency: nil, date_time: nil)
def initialize(type: nil, text: nil, media: nil, payload: nil, currency: nil, date_time: nil)
@type = type
@text = text
@media = media
@payload = payload
@currency = currency
@date_time = date_time
end
Expand All @@ -56,6 +57,7 @@ def to_hash
type: @type,
text: @text,
media: @media,
payload: @payload,
currency: @currency&.to_hash,
date_time: @date_time&.to_hash
}.reject { |_, v| v.nil? }
Expand Down
2 changes: 1 addition & 1 deletion lib/plivo/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Plivo
VERSION = "4.55.2".freeze
VERSION = "4.56.0".freeze
end

0 comments on commit a3a72a0

Please sign in to comment.