Skip to content
Snippets Groups Projects
Commit 845e8df8 authored by Jakob Sack's avatar Jakob Sack
Browse files

Display a warning if email goes to noreply@...

parent 70b027dd
No related branches found
No related tags found
No related merge requests found
/**
* @author Jakob Sack <mail@jakobsack.de>
*
* Mail
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
define(function() {
'use strict';
return function(options) {
var noreply = false;
var isToNoreply = function(recipient){
var localFrom = recipient.email.substring(0, recipient.email.lastIndexOf('@'));
if (localFrom == 'noreply') {
noreply = true;
}
};
this.to.forEach(isToNoreply);
this.cc.forEach(isToNoreply);
this.bcc.forEach(isToNoreply);
if (noreply) {
return options.fn(this);
} else {
return options.inverse(this);
}
};
});
......@@ -30,6 +30,9 @@
/>
<label for="bcc" class="bcc-label transparency">{{ t 'bcc' }}</label>
</div>
{{#ifToNoreply}}
<div class="warning">{{ t 'This email came from a noreply@... address. Make sure to change the recipient before sending the reply.' }}</div>
{{/ifToNoreply}}
{{#unless isReply}}
<input type="text" name="subject" value="{{subject}}" class="subject" autocomplete="off"
placeholder="{{ t 'Subject' }}" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment