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

Add Twilio content template type #5183

Merged
merged 3 commits into from May 8, 2024
Merged

Add Twilio content template type #5183

merged 3 commits into from May 8, 2024

Conversation

norkans7
Copy link

No description provided.

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (631e6b4) to head (9408d3f).
Report is 4 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@norkans7 norkans7 changed the title WIP add Twilio content template type Add Twilio content template type Apr 17, 2024
@norkans7 norkans7 marked this pull request as ready for review April 17, 2024 16:32

class TwilioType(TemplateType):
slug = "whatsapp"
variable_regex = re.compile(r"{{(\d+)}}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
)
elif content_type == "twilio/call-to-action":
button_type = action["type"].upper()
Copy link
Member

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

@norkans7 norkans7 requested a review from rowanseymour May 8, 2024 15:15

class TwilioType(TemplateType):
slug = "whatsapp"
variable_regex = re.compile(r"{{[ ]*([A-Za-z0-9]+)[ ]*}}")
Copy link
Member

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

"1": 0,
"3": 1,
},
"params": [{"type": "text"}, {"type": "text"}],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"params" ?

Copy link
Author

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.

@norkans7 norkans7 requested a review from rowanseymour May 8, 2024 21:28
@rowanseymour rowanseymour merged commit 4413cf2 into main May 8, 2024
5 checks passed
@rowanseymour rowanseymour deleted the twilio-templates-sync branch May 8, 2024 23:22
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants