-
Notifications
You must be signed in to change notification settings - Fork 71
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
Prep for support for more WA templates components #664
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #664 +/- ##
==========================================
- Coverage 74.44% 74.14% -0.31%
==========================================
Files 98 98
Lines 13130 13166 +36
==========================================
- Hits 9775 9762 -13
- Misses 2665 2714 +49
Partials 690 690 ☔ View full report in Codecov by Sentry. |
cd73dc8
to
adc3c7a
Compare
if len(templating.Params) == 0 { | ||
component := &Component{Type: "body"} | ||
|
||
for _, v := range templating.Variables { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept supporting the templating variables so this can be deployed even if the goflow changes are not yet done
handlers/meta/whatsapp/templates.go
Outdated
@@ -39,3 +44,67 @@ func GetTemplating(msg courier.MsgOut) (*MsgTemplating, error) { | |||
|
|||
return metadata.Templating, nil | |||
} | |||
|
|||
func GetTemplatePayload(templating MsgTemplating, lang string) *Template { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this method to keep the code DRY between WAC and D3C channels
component := &Component{Type: "body"} | ||
for k, v := range templating.Params { | ||
if k == "body" { | ||
component := &Component{Type: "body"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just body to keep the same features but no new components supported for legacy WA channels
9d2da92
to
1b66fce
Compare
Params map[string][]struct { | ||
Type string `json:"type"` | ||
Value string `json:"value"` | ||
} `json:"params"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's call this parameters
to match the meta side of things
No description provided.