mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
wip
This commit is contained in:
parent
66a37f5918
commit
4377a05716
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Http\Controllers\ClientPortal;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ClientContact;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EmailPreferencesController extends Controller
|
||||
{
|
||||
public function index(ClientContact $clientContact, Request $request): \Illuminate\View\View
|
||||
{
|
||||
if (!$request->hasValidSignature()) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$data['recieve_emails'] = $clientContact->is_locked ? false : true;
|
||||
$data['logo'] = $clientContact->company->present()->logo();
|
||||
|
||||
return $this->render('generic.email_preferences', $data);
|
||||
}
|
||||
|
||||
public function update(ClientContact $clientContact, Request $request): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
if (!$request->hasValidSignature()) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$clientContact->is_locked = $request->has('recieve_emails') ? false : true;
|
||||
$clientContact->save();
|
||||
|
||||
return back()->with('message', ctrans('texts.updated_settings'));
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +99,8 @@ class Email implements ShouldQueue
|
||||
{
|
||||
MultiDB::setDb($this->company->db);
|
||||
|
||||
info('here 1');
|
||||
|
||||
$this->setOverride()
|
||||
->initModels()
|
||||
->setDefaults()
|
||||
@ -241,6 +243,8 @@ class Email implements ShouldQueue
|
||||
{
|
||||
$this->mailable = new EmailMailable($this->email_object);
|
||||
|
||||
info('here 2');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -264,6 +268,10 @@ class Email implements ShouldQueue
|
||||
$mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain, $this->client_mailgun_endpoint);
|
||||
}
|
||||
|
||||
info("here 4");
|
||||
info($this->mailable->view);
|
||||
info(print_r($this->mailable));
|
||||
|
||||
/* Attempt the send! */
|
||||
try {
|
||||
nlog("Using mailer => ". $this->mailer. " ". now()->toDateTimeString());
|
||||
|
@ -765,6 +765,8 @@ class HtmlEngine
|
||||
$data[$key] = $value['value'];
|
||||
}
|
||||
|
||||
info("here 3");
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,11 @@
|
||||
</p>
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
<h1>Hello world</h1>
|
||||
<p>@isset($portal_url) {{ $portal_url }} @endisset</p>
|
||||
<p>After portal</p>
|
||||
|
||||
@if(isset($unsubscribe_link))
|
||||
<p><a href="{{$unsubscribe_link}}">{{ ctrans('texts.unsubscribe') }}</a></p>
|
||||
@endif
|
@ -0,0 +1,37 @@
|
||||
@extends('portal.ninja2020.layout.clean') @section('meta_title',
|
||||
ctrans('texts.preferences')) @section('body')
|
||||
<div class="flex h-screen">
|
||||
<div class="m-auto md:w-1/3 lg:w-1/5">
|
||||
<div class="flex flex-col items-center">
|
||||
<img
|
||||
src="{{ $logo }}"
|
||||
class="border-gray-100 h-18 pb-4"
|
||||
alt="Invoice Ninja logo"
|
||||
/>
|
||||
<h1 class="text-center text-2xl mt-10">
|
||||
{{ ctrans('texts.email_settings') }}
|
||||
</h1>
|
||||
|
||||
<form class="my-4" method="post">
|
||||
@csrf @method('put')
|
||||
|
||||
<label for="recieve_emails">
|
||||
<input type="checkbox" name="recieve_emails"
|
||||
id="recieve_emails"
|
||||
{{ $recieve_emails ? 'checked' : '' }} />
|
||||
|
||||
<span>
|
||||
{{ ctrans('texts.recieve_emails') }}
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<div class="block my-4">
|
||||
<button class="button button-secondary button-block">
|
||||
{{ ctrans('texts.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\ClientPortal\EmailPreferencesController;
|
||||
use App\Http\Controllers\Auth\ContactForgotPasswordController;
|
||||
use App\Http\Controllers\Auth\ContactLoginController;
|
||||
use App\Http\Controllers\Auth\ContactRegisterController;
|
||||
@ -159,3 +160,7 @@ Route::fallback(function () {
|
||||
abort(404);
|
||||
|
||||
})->middleware('throttle:404');
|
||||
|
||||
|
||||
Route::get('client/email_preferences/{clientContact}', [EmailPreferencesController::class, 'index'])->name('client.email_preferences');
|
||||
Route::put('client/email_preferences/{clientContact}', [EmailPreferencesController::class, 'update']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user