Hello!
I’m trying to generate a string consisting of event properties and some other characters. This should then be Base64 encoded and append to a URL. The use case is to create a unique URL in a transactional email, allowing the recipient to login into a returns platform with a single click, without the need to enter order number or email.
The event properties are
{{ event.OrderId|default:'' }}
(e.g. 321645)
and
{{ event.ShippingAddress.Email|default:'' }}
(e.g. example@email.com)
I also need to add a few static characters to this - a : between the event values and :company at the end.
With the examples above, the full string would be: 321645:example@email.com:company
I manage to apply the
| base64_encode
django filter when using non-event properties, but for some reason the preview doesn’t like the event.OrderId property. The ShippingAddress.Email property works fine.
This code would seem correct but is not accepted:
{{ event.OrderId|default:'' | append:':' | append:event.ShippingAddress.Email|default:'' | append:':company' | base64_encode }}
This code, on the other hand, is accepted but doesn’t actually pull a value from the OrderId property - so the string only turns out as :example@email.com:company
{{ OrderId|default:'' | append:':' | append:event.ShippingAddress.Email|default:'' | append:':company' | base64_encode }}
The {{ event.OrderId|default:'' }} tag on its own displays the order number fine, but not together with the base64_encode filter. So I’m wondering what I’m missing.
Grateful for any help!