spacefill / gibbon-mail

Send mails with mjml Template and JSON Schema
3 stars 1 forks source link

When lang parameter is set and lang file missing then use default file #3

Closed stephane-klein closed 3 years ago

stephane-klein commented 3 years ago

@eliasdemnati I suggest to improve the multi-language support:

If this request is send:

{
  "from": "no-reply@example.com",
  "to": "john.doe@example.com",
  "lang": "de"
}

and one de.[text|subject|mjml] files missing then Gibbon mail must use default.[text|subject|mjml] file.

I think the code must be updated here.

If this suggestion is implemented, then don't forget to update the documentation.

eliasdemnati commented 3 years ago

@stephane-klein This is already implemented here: https://github.com/spacefill/gibbon-mail/blob/bda17b01a74f7abbdab8aa3476b38a7c3c63ab3d/backend/src/app.js#L187-L192

I feel like the documentation is pretty clear also: https://github.com/spacefill/gibbon-mail#how-does-the-multi-language-support-works

You also need to let a default file in case the language is not found or no language is requested.

So I'm not really sure what is the problem ?

MichaelTSS commented 3 years ago

@stephane-klein @eliasdemnati

I think it would be nice if the README.md could include some examples :

stephane-klein commented 3 years ago

@eliasdemnati ok, this feature is already implemented.

I suggest to improve readme with a explicit example.