Skip to content
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

Adding payload parameter in whatsapp templates #237

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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-12)
**Feature - Support for dynamic payload in whatsapp templates**
- Added new params `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
Loading