FusionAuth / fusionauth-node-cli

https://fusionauth.io
Other
1 stars 6 forks source link

Add commands for email templates #2

Closed ColinFrick closed 1 year ago

ColinFrick commented 1 year ago

There should be similar commands for working with email templates:

Handling for HTML / Text templates and localization must be implemented.

For consideration:

mooreds commented 1 year ago

This would be cool. I'd suggest that you have the following folder structure under the TMP dir:

emails/
   default/
      9dd63c26-5c18-4f9e-aa03-d414b05e529f/
         html_body.html
         text_body.txt
         name.txt
         default_subject.txt
         from_email.txt
         default_from_name.txt
      3bd2a8c6-513f-4fc3-908f-7cb68e743893/
   en/
   de/

So the pattern is email/locale/template_id and all the files needed to patch the email object are stored in that directory.

ColinFrick commented 1 year ago

Because the localized templates are contained in the email object itself wouldn't it make more sense to structure the directory like this?


emails/
    9dd63c26-5c18-4f9e-aa03-d414b05e529f/
        name.txt
        from_email.txt
        default/
            html_body.txt
            text_body.txt
            from_name.txt
            subject.txt
        af_NA/
            html_body.txt
            text_body.txt
            from_name.txt
            subject.txt
        de/
mooreds commented 1 year ago

Ah, good point. Makes sense.