Skip to content
Snippets Groups Projects
Unverified Commit 8e314474 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #684 from nextcloud/noreply

Add warning if replying to noreply@...
parents fb23a33e f14a0613
No related branches found
No related tags found
No related merge requests found
......@@ -410,6 +410,12 @@ textarea.message-body {
padding-right: 25%;
}
#app .message-composer .composer-fields .noreply-box {
margin-top: 0;
background: #fdffc3;
padding-left: 64px;
}
.composer-cc-bcc {
position: relative;
}
......
/**
* @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';
function isToNoreply(recipient) {
var user = recipient.email.substring(0, recipient.email.lastIndexOf('@'));
return ['noreply', 'no-reply'].indexOf(user) !== -1;
}
return function(options) {
var noreplyInTo = this.to.some(isToNoreply);
var noreplyInCc = this.cc.some(isToNoreply);
var noreplyInBcc = this.bcc.some(isToNoreply);
if (noreplyInTo || noreplyInCc || noreplyInBcc) {
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 noreply-box">{{ t 'Note that the mail came from a noreply address so your reply will probably not be read.' }}</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