parcelvoy / platform

Parcelvoy: Open source multi-channel marketing automation platform. Send data-driven emails, sms, push notifications and more!
https://parcelvoy.com
MIT License
261 stars 47 forks source link

Unsubscribe link does not work #440

Closed mattes3 closed 7 months ago

mattes3 commented 7 months ago

One of my list members complained that they could not unsubscribe. Their unsubscribe link looks like this:

https://example.com/c?u=8GK2YXXVE1&c=M3XVMDV816&s=3422&r=https%253A%252F%252Fexample.com%252Funsubscribe%252Femail%253Fu%2526%2523x3D%253B8GK2YXXVE1%2526amp%253Bc%2526%2523x3D%253BM3XVMDV816%2526amp%253Bs%2526%2523x3D%253B3422

When I click on the unsubscribe link, I get a JSON-formatted error message like this: {"status":"error","error":"User does not exist!","code":4001}

What's wrong?

pushchris commented 7 months ago

@mattes3 if you have click wrapping enabled you have to use {{{ unsubscribeEmailUrl }}} instead so that the URL isn't HTML escaped before being URL encoded. Didn't have this anywhere in the documentation so apologies there, in hindsight should've just made the library handle that case better. Have put up a change that tells Handlebars not to HTML encode that value so it should no longer be an issue (no need to change to triple brackets). Also updated the documentation.

mattes3 commented 7 months ago

Ah, that's good. I fixed the templates, thank you!

pushchris commented 7 months ago

With the latest release you can use either double or triple brackets without issue, no need to change templates! Realized it was confusing so want things to be as simple as possible.