|
| 1 | +# @conjoon/extjs-app-webmail Documentation |
| 2 | + |
| 3 | +**extjs-app-webmail** is a **coon.js** package and is tagged as such in the |
| 4 | +`package.json`: |
| 5 | + |
| 6 | +```json |
| 7 | +{ |
| 8 | + "coon-js": { |
| 9 | + "package": { |
| 10 | + "autoLoad": { |
| 11 | + "registerController": true |
| 12 | + }, |
| 13 | + "config" : "${package.resourcePath}/extjs-app-webmail.conf.json" |
| 14 | + } |
| 15 | + } |
| 16 | +} |
| 17 | +``` |
| 18 | + |
| 19 | +By default, this package's configuration can be found in this package's `resources` folder |
| 20 | +in a file named `extjs-app-webmail.conf.json`. |
| 21 | + |
| 22 | +### Required Services |
| 23 | +This package requires a service that complies with the REST API described in `rest-api-email` which can be found |
| 24 | +in the [REST API description](https://github.com/conjoon/rest-api-description) of the **conjoon**-project. |
| 25 | + |
| 26 | +#### Mocking required Services |
| 27 | +When using this package without a backend implementation, your app can use the |
| 28 | +[extjs-dev-webmailsim](https://github.com/conjoon/extjs-dev-webmailsim) package of |
| 29 | +the [conjoon-project](https://github.com/conjoon). |
| 30 | + |
| 31 | + |
| 32 | +## What goes into a `extjs-app-webmail` configuration? |
| 33 | + |
| 34 | +The configuration file for this package is built from various key/value-pairs, configuring the behavior |
| 35 | +and appearance of the email client: |
| 36 | + |
| 37 | +```json |
| 38 | +{ |
| 39 | + "title": "Email", |
| 40 | + "plugins": { |
| 41 | + "components": [ |
| 42 | + { |
| 43 | + "cmp": "cn_mail-mailmessagegrid", |
| 44 | + "fclass": "conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad", |
| 45 | + "event": "cn_init" |
| 46 | + } |
| 47 | + ], |
| 48 | + "controller": [ |
| 49 | + { |
| 50 | + "xclass": "conjoon.cn_mail.app.plugin.NewMessagesNotificationPlugin", |
| 51 | + "args": [ |
| 52 | + { |
| 53 | + "interval": 240000 |
| 54 | + } |
| 55 | + ] |
| 56 | + } |
| 57 | + ] |
| 58 | + }, |
| 59 | + "resources": { |
| 60 | + "images": { |
| 61 | + "notifications": { |
| 62 | + "newEmail": "resources/images/notification/newmail.png" |
| 63 | + } |
| 64 | + }, |
| 65 | + "sounds": { |
| 66 | + "notifications": { |
| 67 | + "newEmail": "resources/sounds/notification/newmail.wav" |
| 68 | + } |
| 69 | + }, |
| 70 | + "templates": { |
| 71 | + "html": { |
| 72 | + "editor": "resources/templates/html/editor.html.tpl", |
| 73 | + "reader": "resources/templates/html/reader.html.tpl" |
| 74 | + } |
| 75 | + } |
| 76 | + }, |
| 77 | + "service": { |
| 78 | + "rest-api-email": { |
| 79 | + "base": "https://ddev-ms-email.ddev.site/rest-api-email/api/v0/" |
| 80 | + } |
| 81 | + } |
| 82 | +} |
| 83 | +``` |
| 84 | + |
| 85 | +#### Static resources<a name="staticResources"></a> |
| 86 | +The configuration allows for static resources to be configured, making it possible to change the |
| 87 | +appearance of the email client. The dot-notation for the configuration options is as follows: |
| 88 | + |
| 89 | +- `title` - The title of the package. This is used for assembling navigation entries, or changing the |
| 90 | + `document.title` of the browser instance the application runs in. This package notifies interested |
| 91 | + observers with this title whenever view of the package gets activated and gains the focus. |
| 92 | +- `resources.images.notifications.newEmail` - an icon to show with the desktop notification when new email messages are coming in. |
| 93 | +- `resources.sounds.notifications.newEmail` - a notification sound to play when new email messages are coming in. |
| 94 | +- `templates.html.editor` - an html-template to use with the message editor. |
| 95 | +- `templates.html.reader` - an html-template to use with the message reader. |
| 96 | + |
| 97 | +#### Plugins |
| 98 | +There are several plugins preconfigured for **extjs-app-webmail**. Please consult the documentation |
| 99 | +of the plugins for providing constructor arguments. |
| 100 | + - `conjoon.cn_mail.view.mail.message.grid.feature.PreviewTextLazyLoad` - a plugin for lazy loading |
| 101 | +email message preview texts in the grid, making sure that envelope information of available messages |
| 102 | +are loaded and rendered first. |
| 103 | + - `conjoon.cn_mail.app.plugin.NewMessagesNotificationPlugin` - a plugin for automatically querying mailboxes |
| 104 | +for new messages. Plays notification sounds when new messages have been received. If allowed by the user, |
| 105 | +desktop notifications are shown for new messages, too. The default interval |
| 106 | +for looking up new messages is set to 240000 ms. Additional resources for this plugin can be configured |
| 107 | +with the [static resources](#staticResources). |
| 108 | + |
| 109 | +#### Rest API |
| 110 | +- `service` - Endpoint configuration for this package. Used to create required URLs for outgoing |
| 111 | + HTTP-requests. Holds the key `rest-api-email.base` that must hold the base URL where the endpoints for |
| 112 | + email related operations as described in [rest-api-mail](https://github.com/conjoon/rest-api-description) can be found. |
0 commit comments