voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.7k stars 500 forks source link

Image Deletion integration #543

Closed DylanHDonsky closed 4 years ago

DylanHDonsky commented 5 years ago

i am working on a fork of mosaico that allows me to work with a database instead of localstorage so multiple users can access their own templates as well as share with others accross the application. the issue i am having is that the gallery is still shared, and i don't have an issue with that, but file management and image deletion are pretty crucial after a while and i am trying to find a means of storing what images are used in a template via a variable of some sort (not sure if the viewModel already stores this information somewhere) so on save it would upload the current images being used in said template so on deletion there is a database that contains images currently in use and any that aren't can be deleted. is there any such means of figuring out what images are in the template via viewModel or anything else that wouldn't require scraping the entire HTML looking for src?

bago commented 4 years ago

there's no such list. Scrape the html and change the "dynamically resized images" with statically resized images, so you also get much better performances.

PS: you can start mosaico with a different backend/backendurl for each user, so each one have its own folder. This is done in the https://mosaico.io demo site, too.