Hid 'test email' button until issue updating connection info is resolved

This commit is contained in:
Hillel Coren 2016-02-03 22:45:39 +02:00
parent 1f105b456f
commit 0ce9e426d9
2 changed files with 4 additions and 4 deletions

View File

@ -206,15 +206,15 @@ class AppController extends BaseController
Config::set('mail.from.address', $email);
Config::set('mail.from.name', $fromName);
$data = [
'text' => 'Test email',
];
try {
$this->mailer->sendTo($email, $email, $fromName, 'Test email', 'contact', $data);
$response = $this->mailer->sendTo($email, $email, $fromName, 'Test email', 'contact', $data);
return 'Sent';
return $response === true ? 'Sent' : $response;
} catch (Exception $e) {
return $e->getMessage();
}

View File

@ -48,7 +48,7 @@
->value(isset($_ENV['MAIL_USERNAME']) ? $_ENV['MAIL_USERNAME'] : '') !!}
{!! Former::password('mail[password]')->label('Password')
->value(isset($_ENV['MAIL_PASSWORD']) ? $_ENV['MAIL_PASSWORD'] : '') !!}
{!! Former::actions( Button::primary('Send test email')->small()->withAttributes(['onclick' => 'testMail()']), '&nbsp;&nbsp;<span id="mailTestResult"/>' ) !!}
{{-- Former::actions( Button::primary('Send test email')->small()->withAttributes(['onclick' => 'testMail()']), '&nbsp;&nbsp;<span id="mailTestResult"/>' ) --}}
</div>
</div>
@endif