Customize notification emails Ametys Workspaces (version 2.10.x or lower)


Ametys Workspaces provides a template for project space notifications at mail .

This template can be overloaded in your charter to customize the logo, colors, font, ...

As e-mail formats are very sensitive, we strongly recommend that you don't try to personalize anything other than your logo, color and font.

Installation

Refer to setting up the charter (see Customizing the charter Ametys Workspaces).

The zip provided includes an example of notification mail overload.

Personalize your e-mails

The rest of this document refers to the "myskin" charter provided as an example.
Term to be replaced by the name you have given to your charter.

Custom colors / fonts

The colors and fonts used are defined via variables XSL.
Add to your chart a file skins/myskin/stylesheets/mail /component/variables .xsl in which you redefine the necessary variables as follows:

<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" 
                              xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper"
                              xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:import href="plugin:workspaces://stylesheets/mail/component/variables.xsl"/>
    
    <xsl:variable name="primary">#e8590c</xsl:variable>
    <xsl:variable name="text-default">#313131</xsl:variable>
    <xsl:variable name="text-light">#7F8182</xsl:variable>
    <xsl:variable name="text-contrast">#FFFFFF</xsl:variable>

<xsl:variable name="border-primary">#e8590c</xsl:variable>
    <xsl:variable name="border-highlight">#C1C1C1</xsl:variable>
    
</xsl:stylesheet>

The list of available (and therefore overloadable) variables is available in the file stylesheets/mail/component/variables.xsl from plugin "workspaces".

Logo customization

The logo appears in the header and footer of e-mails.

To use your own logo, you need to override the "header-logo-img" and "footer-logo-img" templates.

Place your logo in PNG format in a resource directory in your charter (e.g. templates/common/img/logo-mail.png).
The initial logo dimensions are 56x113 pixels.

Create the file skins/myskin/stylesheets/mail /component/header .xsl in your skin. It must contain your overload as in the example below:

<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
                              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper">
                              
<xsl:import href="plugin:workspaces://stylesheets/mail/component/header.xsl"/>
    
  <xsl:template name="header-logo-img">
      <img width="164" height="37" src="{ametys:skinURL('templates/common/img/logo-mail.png'}" alt="My company" />
  </xsl:template>
</xsl:stylesheet>

Remember to customize the "alt" alternative.

Do the same with the file skins/myskin/stylesheets/mail /component/footer .xsl

<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
                              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:ametys="org.ametys.web.transformation.xslt.AmetysXSLTHelper">
                              
  <xsl:import href="plugin:workspaces://stylesheets/mail/component/footer.xsl"/>
    
  <xsl:template name="footer-logo-img">
      <img width="164" height="37" alt="My company" src="{ametys:skinURL('templates/common/img/logo-mail.png')}"/>
  </xsl:template>
    
</xsl:stylesheet>
Back to top