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
Add Twilio content template type #5183
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5183 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 469 470 +1
Lines 24973 25066 +93
=========================================
+ Hits 24973 25066 +93 ☔ View full report in Codecov by Sentry. |
24edff0
to
07f8087
Compare
temba/templates/types/twilio/type.py
Outdated
|
||
class TwilioType(TemplateType): | ||
slug = "whatsapp" | ||
variable_regex = re.compile(r"{{(\d+)}}") |
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.
Twilio allows alphanumeric variables https://www.twilio.com/docs/content/using-variables-with-content-api
temba/templates/types/twilio/type.py
Outdated
} | ||
) | ||
elif content_type == "twilio/call-to-action": | ||
button_type = action["type"].upper() |
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.
unless the Twilio docs say that type is sometimes one case and sometimes another.. don't add ambiguity
temba/templates/types/twilio/type.py
Outdated
|
||
class TwilioType(TemplateType): | ||
slug = "whatsapp" | ||
variable_regex = re.compile(r"{{[ ]*([A-Za-z0-9]+)[ ]*}}") |
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.
it specifically says on https://www.twilio.com/docs/content/using-variables-with-content-api that they can't have spaces
(also [ ]*
is not how you match whitespace in a regex)
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.
updated
2a355d6
to
3199fab
Compare
"1": 0, | ||
"3": 1, | ||
}, | ||
"params": [{"type": "text"}, {"type": "text"}], |
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.
"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.
I just removed that, that was deprecated and I thought we needed that until the editor was updated, the editor has not been already updated now.
No description provided.