uSked / mosaico-php-backend

A PHP backend for Mosaico
GNU General Public License v3.0
32 stars 34 forks source link

Support save and load emails #12

Open bwl21 opened 8 years ago

bwl21 commented 8 years ago

Even if the discussion on https://github.com/voidlabs/mosaico/issues/50 did not come to an end, I open this issue to get support for storing/listing/retrieveing Newsletters (emails) by the mosaico-php-backend.

mherbold commented 8 years ago

Yeah this is something we want to do also. Storing the emails in cookies is not portable. I'd much prefer to be able to store it in a database so it can be shared by multiple users and can be retrieved on multiple devices.

bwl21 commented 8 years ago

Do you have an idea how to do this? Are you also using local storage for now?

mherbold commented 8 years ago

We are still using Mosaico's default cookies storage. I have not looked into rerouting this data into a database back end yet. I suspect it will require some modification of the Mosaico base code itself but I haven't taken a look yet.

bago commented 8 years ago

Maybe it's not friendly, but you can do this without changes to Mosaico library: we use in production the same library and simply add our own "plugins" to deal with custom backend (salve, load, test).

localstorage is a plugin that can be replaced by calling a different initialization method.

NJseo commented 8 years ago

When I click to download the HTML, it seems to goto a blank page at the dl/ folder. It would be nice if I could figure out how to pass it back to a textarea entry.

bertasoft commented 8 years ago

Ehi bago, can you post the plugin for save and load with backend? Thanks

bago commented 8 years ago

I cannot opensource that plugin, sorry.

notchris commented 8 years ago

In a workplace, I see no benefit to only providing localstorage as the method for saving. It would be much more useful to save emails to the backend.

bwl21 commented 8 years ago

I think we need to respect that Bago cannot open source his solution. So let us contribute something of our own.

First we need a specification of the interfaces, in particular of the server interface. I see the following usecases:

  1. list available emails
  2. open a particular email
  3. create a new email
  4. save a particular email
  5. delete a particular email
  6. rename a particujlar email
  7. clone a particular email