Fix test mail behaviour

* ref #8854
* prevent default of "send test mail" button
* drop unused form serialization
* use display name of user for test mail
This commit is contained in:
Morris Jobke 2014-06-25 15:32:40 +02:00
parent b1116880f8
commit 6e2aaaaa31
2 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ class Controller {
$defaults = new \OC_Defaults();
try {
\OC_Mail::send($email, $_POST['user'],
\OC_Mail::send($email, \OC_User::getDisplayName(),
$l->t('test email settings'),
$l->t('If you received this email, the settings seem to be correct.'),
\OCP\Util::getDefaultEmailAddress('no-reply'), $defaults->getName());

View File

@ -123,10 +123,10 @@ $(document).ready(function(){
});
});
$('#sendtestemail').click(function(){
$('#sendtestemail').click(function(event){
event.preventDefault();
OC.msg.startAction('#sendtestmail_msg', t('settings', 'Sending...'));
var post = $( "#sendtestemail" ).serialize();
$.post(OC.generateUrl('/settings/admin/mailtest'), post, function(data){
$.post(OC.generateUrl('/settings/admin/mailtest'), '', function(data){
OC.msg.finishedAction('#sendtestmail_msg', data);
});
});