Skip to content

Conversation

@Kaczmi
Copy link

@Kaczmi Kaczmi commented Oct 9, 2025

  • bug fix / new feature? not sure
  • BC break? yes

Currently, setHTMLBody in Nette\Mail supports a basePath for automatically embedding local images as CID attachments. Relative paths like img/logo.svg work correctly, but absolute paths starting with a slash (e.g. /img/logo.svg) are ignored and not embedded.

This PR updates the logic so that images referenced with a leading slash are correctly resolved relative to the provided basePath, allowing projects that use Webpack-generated assets (which always output to a fixed public folder with leading slashes) to work without breaking existing templates that rely on relative paths.

Here, basePath for mails is intended to represent the www folder of the application, making it clear that absolute paths are resolved relative to the web root.

@Kaczmi Kaczmi force-pushed the allow-leading-slash-4.0.3 branch from aa94a75 to 941ea7c Compare October 9, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant