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 optional attribute parameters to images inserted via %file()% command #216

Closed
RealRaven2000 opened this issue Nov 13, 2022 · 1 comment
Assignees

Comments

@RealRaven2000
Copy link
Owner

The %file()% command can be used to insert inline images into the email. In order to better control styling and other aspects, allow adding attributes and values as parameters. For example:

%file(img/bargain-upg-bf-de.png,id=bargainStar,width=192)%

This should be converted by SmartTemplates reading the image as bitstream and append the attributes, like this:

<img
src="data:image/png;filename=bargain-upg-bf-de.png;base64,iVBORw0KGgoAAAAN...." id="bargainStar" width="192">

If a string is appended without the "=" then it will be regarded as the optional "alt" argument.

%file(img/bargain-upg-bf-de.png,id=bargainStar,"save 40 per cent")%

becomes this:

<img
src="data:image/png;filename=bargain-upg-bf-de.png;base64,iVBORw0KGgoAAAAN...." id="bargainStar" alt="save 40 per cent">

This makes it easy to add style rules to add more control over layout.

@RealRaven2000
Copy link
Owner Author

implemented in 3.15 released on 25/11/2022

RealRaven2000 added a commit that referenced this issue Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant