You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be a good feature if we could access the context from a filter and use some global variables here, like the selected language, using of preview mode, etc.
For example, consider the following email template:
Here we have a custom filter, which can translate the corresponding strings. But we have to pass the ln param to every filter, because the filter itself doesn't know the actual language, however it has been set in the context (context["ln"] = "en").
Another example is an embedded image: <img src="{{'spacer.gif'|images:preview}}"/>
Here the filter replaces the src to a full URL (in preview mode) or to a cid:xxxx embed mark. Another issue here is that we need to store somehow which images we should include later, when sending the actual mail, so we can embed them. Now we have to rescan the template file, looking for src attribs and css backgrounds, and get the images from here, however the images filter could do that for us and store the image list on the context itself. Later we can easily grab the info from here.
Thanks for your great work!
The text was updated successfully, but these errors were encountered:
It would be a good feature if we could access the context from a filter and use some global variables here, like the selected language, using of preview mode, etc.
For example, consider the following email template:
Here we have a custom filter, which can translate the corresponding strings. But we have to pass the
ln
param to every filter, because the filter itself doesn't know the actual language, however it has been set in the context (context["ln"] = "en"
).Another example is an embedded image:
<img src="{{'spacer.gif'|images:preview}}"/>
Here the filter replaces the src to a full URL (in preview mode) or to a
cid:xxxx
embed mark. Another issue here is that we need to store somehow which images we should include later, when sending the actual mail, so we can embed them. Now we have to rescan the template file, looking for src attribs and css backgrounds, and get the images from here, however theimages
filter could do that for us and store the image list on the context itself. Later we can easily grab the info from here.Thanks for your great work!
The text was updated successfully, but these errors were encountered: