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

Update Punchh Dynamic Code Generation liquid #7828

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

alex-braze
Copy link
Collaborator

@alex-braze alex-braze commented Aug 6, 2024

Summary

We found out during live testing on a call with Punchh today that our liquid was out of date and wasn't working.

Related PRs, issues, or features (optional)

Feature release date (optional)

  • N/A

Contributor checklist

  • I confirm that my PR meets the following:
    • I signed the Contribution License Agreement (CLA).
    • My style and voice follows the Braze Style Guide.
    • My content contains correct spelling and grammar.
    • All links are working correctly.
    • If I renamed or moved a file or directory, I set up URL redirects for each file.
    • If I updated or replaced an image, I did not remove the original image file from the repository. (For more information, see Updating an image).
    • If my PR is related to a paid SKU, third party, SMS, AI, or privacy, I have received written approval from Braze Legal.

Submitting for review

If your PR meets the above requirements, select Ready for review, then add a reviewer:

  • Non-Braze contributors: Add braze-inc/docs-team as the reviewer.
  • Braze employees: Have any relevant subject matter experts (like engineers or product managers) review your work first, then add the tech writer assigned to your specific vertical. If you're not sure which tech writer to add, you can add braze-inc/docs-team instead.

Thanks for contributing! We look forward to reading your work.

replacing liquid as previous liquid was not generating correctly
Copy link
Contributor

@internetisaiah internetisaiah left a comment

Choose a reason for hiding this comment

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

Hey @alex-braze , most everything here looks good, but I noticed that most of the {% raw %}{% endraw %} tags were moved, which were breaking your test deployment. Just for a little background:

If you have any Liquid on a docs page, the docs site will try to execute that code as if its real Liquid. To avoid this, you need to wrap it in raw tags, like this:

{% raw %}
```liquid
https://SERVER_NAME.punchh.com/request_coupons/DYNAMIC_COUPON_GENERATION_TOKEN?sign={{jwt}}
```
{% endraw %}

Or like this:

To link to a Puncch-hosted web page, add the Dynamic Generation URL provided in Punchh Campaign creation UI and replace `GENERATED_SIGNATURE` with `{% raw %}{{jwt}}{% endraw %}`:

Hope this helps! Please let me know if you have questions. You can select Add Suggestion to Batch for each suggestion I left (you have to do this from the Files tab), then commit them all at once to update the page 👍🏽

@internetisaiah internetisaiah self-assigned this Aug 6, 2024
Co-authored-by: isaiah robinson <95643215+internetisaiah@users.noreply.github.com>
Copy link
Contributor

@internetisaiah internetisaiah left a comment

Choose a reason for hiding this comment

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

Left a couple of comments and one suggestion, but after that, we should be good to go 👍🏽 @alex-braze


You could then leverage [Connected Content]({{site.baseurl}}/user_guide/personalization_and_dynamic_content/connected_content/making_an_api_call/) to insert the code as plain text into any message body. For example:

{% raw %}
```liquid
{% connected_content https://SERVER_NAME.punchh.com/request_coupons/DYNAMIC_COUPON_GENERATION_TOKEN.json?sign={{jwt}} :save punchh_coupon %}
{% connected_content https://example.punchh.com/request_coupons/XXXXXXXXXXXXX.json?sign={{jwt}} :save punchh_coupon %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Its ok if we change the variable names from the original, but lets make sure that these are descriptive variables instead of example or XXXXXXXXXXXXX. Additionally, the variable should be all caps (as that is apart of our style guide).


{% raw %}
```liquid
<img src="https://SERVER_NAME.punchh.com/request_coupons/DYNAMIC_COUPON_GENERATION_TOKEN.png?sign={{jwt}}">`
```
<img src="https://example.punchh.com/request_coupons/XXXXXXXXXXXXX.png?sign={{jwt}}">
Copy link
Contributor

Choose a reason for hiding this comment

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

Its ok if we change the variable names from the original, but lets make sure that these are descriptive variables instead of example or XXXXXXXXXXXXX. Additionally, the variable should be all caps (as that is apart of our style guide).

Copy link
Contributor

@internetisaiah internetisaiah left a comment

Choose a reason for hiding this comment

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

LGTM! Reverted the 11111 variable back to DYNAMIC_COUPON_GENERATION_TOKEN to keep it uniform with the earlier content + ensure that the variable is a descriptive name. Gonna merge and should be good for next deploy tomorrow 👍🏽 Thanks for working quick with me on this 🙌🏽

@alex-braze
Copy link
Collaborator Author

@internetisaiah quick heads up! We had to change the original URL because it is no longer the DYNAMIC_COUPON_GENERATION_TOKEN that is included in the URL! This URL has to be pulled from the Punchh dashboard and does not include the token in it.

@internetisaiah
Copy link
Contributor

internetisaiah commented Aug 7, 2024

@internetisaiah quick heads up! We had to change the original URL because it is no longer the DYNAMIC_COUPON_GENERATION_TOKEN that is included in the URL! This URL has to be pulled from the Punchh dashboard and does not include the token in it.

Ah, what about URL_TOKEN then a link to the Punchh docs on where they can find this? Would you happen to have a link? @alex-braze

@alex-braze
Copy link
Collaborator Author

I'm hesitant to add any variable in that spot specifically because technically the entire dynamic generation URL would be a variable being replaced, but it's kind of confusing to just show this:

DYNAMIC-GENERATION-URL{{jwt}}

Here's where it is referenced in their docs:

https://developers.partech.com/docs/dev-portal-platform-functions/be3c7bd2c3908-punchh-dynamic-coupon-code-generation#:~:text=Dynamic%20Generation%20URL%3A%20This%20URL%20will%20be%20embedded%20in%20the%20email%20as%20a%20link%20or%20an%20image%2C%20as%20required%20by%20the%20business.

@internetisaiah
Copy link
Contributor

@alex-braze , ahh i think i'm understanding your concern now. how's this instead? placeholder values have been replaced with an actual example instead.

https://braze-docs-5jkuv01ju-braze.vercel.app/docs/partners/message_orchestration/channel_extensions/loyalty/punchh/code_generation/#step-3-append-coupon-code-to-message-body

@alex-braze
Copy link
Collaborator Author

@internetisaiah LOVE IT!!!

@internetisaiah internetisaiah merged commit 74f39e1 into develop Aug 7, 2024
3 checks passed
@internetisaiah internetisaiah deleted the alex-braze-patch-2 branch August 7, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants