From 60e5cd15ae5639b91ad4b4cc485cb8e3a4d77173 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz <59456825+mako321@users.noreply.github.com> Date: Mon, 24 Jul 2023 20:46:53 +0200 Subject: [PATCH] Update readme (#75) * Update readme * Update ADMIN.md --- ADMIN.md | 37 ++++++++++++++++++++++++++++++++++++- README.md | 22 +--------------------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/ADMIN.md b/ADMIN.md index 947822d..17a2313 100644 --- a/ADMIN.md +++ b/ADMIN.md @@ -1,3 +1,38 @@ # Admin panel documentation -Coming soon documentation on this package +This package is an extension of the [Template package](https://github.com/EscolaLMS/Templates/blob/main/ADMIN.md) and is used for managing email templates. + +Templates are defined in the *Templates* and *Email* tabs. From the template list, you can create, edit or delete a template. + +![Templates](https://github.com/EscolaLMS/Templates-Email/assets/59456825/c317bc59-4d20-4307-9f58-5301cb5985ca) + +Each email template has a name, an event, and you can set the template to be the default. +Sending an email is only possible for the default template. +The list of events available for selection may vary depending on the installed *escolalms* packages. Each package emits its own events. + +![Template form](https://github.com/EscolaLMS/Templates-Email/assets/59456825/30b51f09-4271-4911-a9aa-4fcf955cb330) + +Clicking the *Preview* button will send an email to you. The values of the variables will be mocked. + +![Preview](https://github.com/EscolaLMS/Templates-Email/assets/59456825/27042b6a-0d9e-4e05-b3d9-4b6b0e1a1797) + +When defining a template, you have variables to use. There are two types of variables global and event-defined. Global variables store general, system-related information, personalized variables store information directly related to the event. +Variables use a convention, with the @ sign before the variable name, to use a variable in a template you need to put the @ sign and the variable name, e.g. @VarSimpleName. + +![Variables](https://github.com/EscolaLMS/Templates-Email/assets/59456825/751d01f5-7448-47bd-b77c-836f5f699174) + +The variables that are in the *required variables* section are the ones you must use in your template. + +![Required variables](https://github.com/EscolaLMS/Templates-Email/assets/59456825/8d8d5282-b74f-4540-883a-67fb3fb250a2) + +Mjml is used to create the content of an email. + +![Email content](https://github.com/EscolaLMS/Templates-Email/assets/59456825/bc67ee9b-e415-4bb9-8df6-b979daa95b8d) + +You can use *Settings* to save recurring parts of the template, e.g. footer or header. +Just define new variables in the *mail* group with the mjml code and then use those variables in the template. + +![Global mail variables](https://github.com/EscolaLMS/Templates-Email/assets/59456825/adb8a588-f3fd-469c-8ed8-fb8667eef776) + +![Content with global variables](https://github.com/EscolaLMS/Templates-Email/assets/59456825/4f69fcfe-7a26-40b5-8e03-a3ae2b0b1cd3) + diff --git a/README.md b/README.md index 67f4972..d03445d 100644 --- a/README.md +++ b/README.md @@ -44,30 +44,10 @@ Each notification is created as a class describing available variables that can ## Tests -Run `./vendor/bin/phpunit --filter 'EscolaLms\\TemplatesEmail\\Tests'` to run tests. See [tests](tests) folder as it contains a basic implementation of Variable (or Template description) class with minimal customisation - a quite good starting point for creating your own. +Run `./vendor/bin/phpunit --filter 'EscolaLms\\TemplatesEmail\\Tests'` to run tests. See [tests](https://github.com/EscolaLMS/Templates-Email/tree/main/tests) folder as it contains a basic implementation of Variable (or Template description) class with minimal customisation - a quite good starting point for creating your own. Test details [![codecov](https://codecov.io/gh/EscolaLMS/Templates-Email/branch/main/graph/badge.svg?token=O91FHNKI6R)](https://codecov.io/gh/EscolaLMS/Templates-Email) [![Tests PHPUnit in environments](https://github.com/EscolaLMS/Templates-Email/actions/workflows/test.yml/badge.svg)](https://github.com/EscolaLMS/Templates-Email/actions/workflows/test.yml) -## Usage on front end - -### Admin panel - -#### **Left menu** - -![Menu](docs/menu.png "Menu") - -#### **List of templates** - -![List of templates](docs/list.png "List of templates") - -#### **Creating/editing template** - -![Creating/editing template](docs/edit.png "Creating or editing template") - ## Permissions No Permissions defined for this package. - -## Roadmap. Todo. Troubleshooting - -- ???