No description
Find a file
Morris Jobke 2befa118aa
Fix drone config
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-12 16:44:40 +02:00
.github Add the issue template 2017-04-05 09:54:07 +02:00
app move code from core to this repo, make it into a standalone app 2014-06-12 16:44:34 +02:00
appinfo Update version on master 2017-05-22 12:42:04 +02:00
controller Fix app code check complains 2016-12-13 13:59:20 +01:00
css hide template editor until a template has been chosen, use meaningful caption for templates 2014-06-12 18:48:42 +02:00
http move code from core to this repo, make it into a standalone app 2014-06-12 16:44:34 +02:00
img add viewBox to app icon for proper scaling in firefox 2016-08-17 18:32:11 +02:00
js Correctly mark messages as an error when unsuccessful 2015-10-15 15:29:28 +02:00
l10n [tx-robot] updated from transifex 2016-04-30 02:39:27 -04:00
lib Skip non-existing templates 2017-04-18 16:21:56 +02:00
templates Add hint to settings 2017-04-27 10:38:18 +02:00
.drone.yml Fix drone config 2018-04-12 16:44:40 +02:00
.travis.yml Update php testing versions 2017-01-23 19:00:13 +01:00
build.xml basic travis support added 2014-07-04 15:36:15 +02:00
README.md Fix some typos and style 2018-03-21 12:05:07 +01:00
settings-admin.php Fix app code check complains 2016-12-13 13:59:20 +01:00

Template editor

✍ Mail template editor

The template editor is only compatible with Nextcloud 11 or older.

We removed the template editor in Nextcloud 12 because we changed how emails are generated. While the customization capabilities offered by the template editor were easy to use, they often resulted in broken emails. To fix this, we designed a much easier mechanism that automatically generates emails which follow the theme settings and look the same in all the different email clients out there.

  • If, for some reason, you need text-only emails, consider simply configuring this on the client side or let the receiving (or even sending) mail server drop the HTML part. Note that there is no security impact from sending html emails, just from displaying them and thus any security risk can only be mitigated by disabling showing html on the client (or removing the HTML part in the mail server).

Modifying the look of emails beyond the theming app capabilities

You can now overwrite templates by writing a class that implements the template interface (or extends it to not need to copy over everything). Easiest way is then put this class into an app and load it (so you do not need to patch it in on every update).

This is the interface of the class that needs to be implemented: https://github.com/nextcloud/server/blob/master/lib/public/Mail/IEMailTemplate.php

That is the implementation that could be extended and used to see how it works: https://github.com/nextcloud/server/blob/master/lib/private/Mail/EMailTemplate.php

An example from nextcloud/templateeditor#23:

  1. Look at the source code of extended class OC\Mail\EMailTemplate::class
  2. Then override what you need in your own OC\Mail\EMailTemplate::class extension

Example

Let's assume that we need to override the email header.

<?php

namespace \OCA\MyApp;

use OC\Mail\EMailTemplate;

class MyClass extends EMailTemplate
{
    protected $header = <<<EOF 
        <table align="center" class="wrapper">
            // your theme email header modification
        </table>
    EOF;
}
  1. Then in config/config.php change mail_template_class to your class namespace
'mail_template_class' => 'OCA\\MyApp\\MyClass',

If you need any help, contact the Nextcloud support team or read a step by step guide in the support portal.