mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 07:14:37 -04:00
log as an option for mail driver
This commit is contained in:
parent
9f420ba084
commit
3b765d32c1
@ -58,9 +58,11 @@ class SetupController extends Controller
|
|||||||
if ($check['system_health'] === false) {
|
if ($check['system_health'] === false) {
|
||||||
info($check);
|
info($check);
|
||||||
|
|
||||||
return response('Oops, something went wrong. Check your logs.'); /* We should never reach this block, but jic. */
|
return response('Oops, something went wrong. Check your logs.'); /* We should never reach this block, but just in case. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $request->all();
|
||||||
|
|
||||||
$mail_driver = $request->input('mail_driver');
|
$mail_driver = $request->input('mail_driver');
|
||||||
|
|
||||||
if (! $this->failsafeMailCheck($request)) {
|
if (! $this->failsafeMailCheck($request)) {
|
||||||
|
@ -33,15 +33,17 @@ class CheckMailRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
info($this->driver);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'driver' => ['required', 'in:smtp,mail,sendmail'],
|
'driver' => ['required', 'in:smtp,mail,sendmail,log'],
|
||||||
'from_name' => ['required'],
|
'from_name' => ['required_unless:driver,log'],
|
||||||
'from_address' => ['required'],
|
'from_address' => ['required_unless:driver,log'],
|
||||||
'username' => ['required'],
|
'username' => ['required_unless:driver,log'],
|
||||||
'host' => ['required'],
|
'host' => ['required_unless:driver,log'],
|
||||||
'port' => ['required'],
|
'port' => ['required_unless:driver,log'],
|
||||||
'encryption' => ['required'],
|
'encryption' => ['required_unless:driver,log'],
|
||||||
'password' => ['required'],
|
'password' => ['required_unless:driver,log'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,12 +37,12 @@ class StoreSetupRequest extends Request
|
|||||||
'db_password' => '',
|
'db_password' => '',
|
||||||
/*Mail driver*/
|
/*Mail driver*/
|
||||||
'mail_driver' => 'required',
|
'mail_driver' => 'required',
|
||||||
'encryption' => 'required',
|
'encryption' => 'required_unless:mail_driver,log',
|
||||||
'mail_host' => 'required',
|
'mail_host' => 'required_unless:mail_driver,log',
|
||||||
'mail_username' => 'required',
|
'mail_username' => 'required_unless:mail_driver,log',
|
||||||
'mail_name' => 'required',
|
'mail_name' => 'required_unless:mail_driver,log',
|
||||||
'mail_address' => 'required',
|
'mail_address' => 'required_unless:mail_driver,log',
|
||||||
'mail_password' => 'required',
|
'mail_password' => 'required_unless:mail_driver,log',
|
||||||
/*user registration*/
|
/*user registration*/
|
||||||
'privacy_policy' => 'required',
|
'privacy_policy' => 'required',
|
||||||
'terms_of_service' => 'required',
|
'terms_of_service' => 'required',
|
||||||
|
@ -196,6 +196,10 @@ class SystemHealth
|
|||||||
|
|
||||||
public static function testMailServer($request = null)
|
public static function testMailServer($request = null)
|
||||||
{
|
{
|
||||||
|
if ($request->driver == 'log') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if ($request && $request instanceof CheckMailRequest) {
|
if ($request && $request instanceof CheckMailRequest) {
|
||||||
config(['mail.driver' => $request->input('driver')]);
|
config(['mail.driver' => $request->input('driver')]);
|
||||||
config(['mail.host' => $request->input('host')]);
|
config(['mail.host' => $request->input('host')]);
|
||||||
@ -225,7 +229,7 @@ class SystemHealth
|
|||||||
return Mail::failures();
|
return Mail::failures();
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json(['message'=>'Success'], 200);
|
return response()->json(['message' => 'Success'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function checkEnvWritable()
|
private static function checkEnvWritable()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="bg-white shadow overflow-hidden rounded-lg mt-6">
|
<div class="bg-white shadow overflow-hidden rounded-lg mt-6" x-data="{ option: 'log' }">
|
||||||
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
||||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||||
{{ ctrans('texts.email_settings') }}
|
{{ ctrans('texts.email_settings') }}
|
||||||
@ -14,14 +14,15 @@
|
|||||||
{{ ctrans('texts.driver') }}
|
{{ ctrans('texts.driver') }}
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd class="text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
<select name="mail_driver" class="input w-full form-select">
|
<select name="mail_driver" class="input w-full form-select" x-model="option">
|
||||||
|
<option value="log">Log</option>
|
||||||
<option value="smtp">SMTP</option>
|
<option value="smtp">SMTP</option>
|
||||||
<option value="mail">Mail</option>
|
<option value="mail">Mail</option>
|
||||||
<option value="sendmail">Sendmail</option>
|
<option value="sendmail">Sendmail</option>
|
||||||
</select>
|
</select>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.from_name') }}
|
{{ ctrans('texts.from_name') }}
|
||||||
</dt>
|
</dt>
|
||||||
@ -29,7 +30,7 @@
|
|||||||
<input type="text" class="input w-full" name="mail_name" value="{{ old('mail_name') }}">
|
<input type="text" class="input w-full" name="mail_name" value="{{ old('mail_name') }}">
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.from_address') }}
|
{{ ctrans('texts.from_address') }}
|
||||||
</dt>
|
</dt>
|
||||||
@ -37,15 +38,15 @@
|
|||||||
<input type="email" class="input w-full" name="mail_address" value="{{ old('mail_address') }}">
|
<input type="email" class="input w-full" name="mail_address" value="{{ old('mail_address') }}">
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.username') }}
|
{{ ctrans('texts.username') }}
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd class="text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
<input type="text" class="input w-full" name="mail_username" value="{{ old('mail_username') }}">
|
<input type="text" class="input w-full" name="mail_username" value="{{ old('mail_username') }}" x-show="option != 'log'">
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.host') }}
|
{{ ctrans('texts.host') }}
|
||||||
</dt>
|
</dt>
|
||||||
@ -53,7 +54,7 @@
|
|||||||
<input type="text" class="input w-full" name="mail_host" value="{{ old('mail_host') }}">
|
<input type="text" class="input w-full" name="mail_host" value="{{ old('mail_host') }}">
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.port') }}
|
{{ ctrans('texts.port') }}
|
||||||
</dt>
|
</dt>
|
||||||
@ -61,7 +62,7 @@
|
|||||||
<input type="text" class="input w-full" name="mail_port" value="{{ old('mail_port') }}">
|
<input type="text" class="input w-full" name="mail_port" value="{{ old('mail_port') }}">
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.encryption') }}
|
{{ ctrans('texts.encryption') }}
|
||||||
</dt>
|
</dt>
|
||||||
@ -72,7 +73,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
{{ ctrans('texts.password') }}
|
{{ ctrans('texts.password') }}
|
||||||
</dt>
|
</dt>
|
||||||
@ -80,7 +81,7 @@
|
|||||||
<input type="password" class="input w-full" name="mail_password">
|
<input type="password" class="input w-full" name="mail_password">
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center">
|
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:flex sm:items-center" x-show="option != 'log'">
|
||||||
<dt class="text-sm leading-5 font-medium text-gray-500">
|
<dt class="text-sm leading-5 font-medium text-gray-500">
|
||||||
<button type="button" class="button button-primary bg-blue-600 py-2 px-3 text-xs" id="test-smtp-connection">
|
<button type="button" class="button button-primary bg-blue-600 py-2 px-3 text-xs" id="test-smtp-connection">
|
||||||
{{ ctrans('texts.send_test_email') }}
|
{{ ctrans('texts.send_test_email') }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user