Skip to content

Commit

Permalink
Update readme (#75)
Browse files Browse the repository at this point in the history
* Update readme

* Update ADMIN.md
  • Loading branch information
mako321 committed Jul 24, 2023
1 parent 4c941e3 commit 60e5cd1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 22 deletions.
37 changes: 36 additions & 1 deletion ADMIN.md
Original file line number Diff line number Diff line change
@@ -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)

22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

- ???

0 comments on commit 60e5cd1

Please sign in to comment.