From b9111ca4ff8ab63cf00bc26fc56c0b50eb3a17d0 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Tue, 8 Aug 2023 21:27:10 +0200 Subject: [PATCH] email templates allow you to build custom emails with variables --- content/hub/whitelabel/index.md | 39 +++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/content/hub/whitelabel/index.md b/content/hub/whitelabel/index.md index 338da7d..a5bfc85 100644 --- a/content/hub/whitelabel/index.md +++ b/content/hub/whitelabel/index.md @@ -13,7 +13,7 @@ weight: 305 toc: true --- -Kerberos Hub can be styled towards your company marketing branding and/or preferred style guides. By injecting a custom CSS file, and overriding our icon library, you can make Kerberos Hub feel like it's your own product; and we do not have any problem with that. +Kerberos Hub can be styled towards your company marketing branding and/or preferred style guides. By injecting a custom CSS file, and overriding our icon library, you can make Kerberos Hub feel like it's your own product; and we do not have any problem with that. We believe that a consistent and streamlined company branding is important when using 3rd party applications in your companies ecosystem. @@ -31,9 +31,9 @@ The recommended approach to add your custom styling is to inject a custom styles To know which element you need to style, we advice [to use the inspect elements tool](https://developer.chrome.com/docs/devtools/open/#:~:text=When%20you%20want%20to%20inspect,the%20element%20and%20select%20Inspect.&text=Or%20press%20Command%20%2B%20Option%20%2B%20C,%2C%20Linux%2C%20Chrome%20OS) of your Chrome/Safari/Firefox browser developer tools. -Once you are happy with your styling, you can proceed with the injection in the front-end container. +Once you are happy with your styling, you can proceed with the injection in the front-end container. -Injection is done through the concept of Persistent Volumes (PV). A PV is mapped in a front-end container, and is overriding the local directory of the front-end container with your changes made in the PV. If you are not familiar with a PV, [you might need to learn about it first](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#:~:text=A%20PersistentVolume%20(PV)%20is%20a,node%20is%20a%20cluster%20resource.). +Injection is done through the concept of Persistent Volumes (PV). A PV is mapped in a front-end container, and is overriding the local directory of the front-end container with your changes made in the PV. If you are not familiar with a PV, [you might need to learn about it first](). Once you created a PV and uploaded your stylesheet, you should [create a Persistent Volume Claim (PVC)](https://github.com/kerberos-io/hub/blob/master/custom-layout/custom-layout-claim.yaml), so you can share it with the Kerberos Hub front-end container. @@ -43,7 +43,7 @@ If all set, commit your changes by doing an `helm install` or `helm upgrade`. ## Custom logo -Similar to **overriding the Kerberos Hub styling** you can inject your own company logo as well. This logo will be used on the login page and sidebar once signed in. Make sure to name your company logo as following, `logo-sidebar.svg`. +Similar to **overriding the Kerberos Hub styling** you can inject your own company logo as well. This logo will be used on the login page and sidebar once signed in. Make sure to name your company logo as following, `logo-sidebar.svg`. To inject your logo, upload it into the same PV as you used for the custom styling. @@ -51,20 +51,20 @@ To inject your logo, upload it into the same PV as you used for the custom styli If you do not like the icons we are using, you can also modify those by injecting your own SVG icon library. An example of the icon library can be found here: [icon.js](https://github.com/kerberos-io/hub/blob/master/custom-layout/icons.js). -All icons are sorted in alphabetic order, and each icon has a generic naming convention and relevant SVG element. +All icons are sorted in alphabetic order, and each icon has a generic naming convention and relevant SVG element. Make sure you are using SVG icons, we do not support other formats at the moment of writing. (function(window) { window["env"] = window["env"] || {}; window["env"]["svg"] = window["env"]["svg"] || {}; - + /* Accounts */ window["env"]["svg"]["accounts"] = ` ` - + /* Activity / pulse (Latest Activity) */ window["env"]["svg"]["activity"] = ` @@ -110,7 +110,7 @@ To activate and inject your email templates, make sure to uncomment the `volumes claimName: custom-layout-claim kerberospipeline: ... - notify: + notify: ... # E-mail templates volumeMounts: @@ -129,4 +129,25 @@ To activate and inject your email templates, make sure to uncomment the `volumes volumes: - name: custom-email-templates persistentVolumeClaim: - claimName: custom-layout-claim \ No newline at end of file + claimName: custom-layout-claim + +Within en email template you can use variables, which are indicated through `{{variable}}`. Each variable will be automatically replaced by the required value. Following variables can be used in your email template. + +- `{{user}}`: user that triggered the message +- `{{text}}`: text of the message +- `{{link}}`: link to the media (recording) +- `{{thumbnail}}`: image (either a base64 or a url). +- `{{classifications}}`: list of classifications detected in the recording. +- `{{timezone}}`: timezone of the account generating the event +- `{{date}}`: date of the media +- `{{time}}`: time of the media +- `{{datetime}}`: datetime of the media +- `{{eventdate}}`: date of the notification +- `{{eventtime}}`: time of the notification +- `{{eventdatetime}}`: datetime of the notification +- `{{devicename}}`: device generating the event +- `{{deviceid}}`: device generating the event +- `{{sites}}`: the list of sites the device is part of +- `{{groups}}`: the list of groups the device is part of +- `{{numberOfMedia}}`: number of media attached to the message +- `{{dataUsage}}`: data usage of the message