update marketing
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-14 11:55:22 +07:00
parent f80fcc4c1b
commit 05fd3230b8
448 changed files with 17545 additions and 5128 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Modules\MarketingAddon\App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Modules\MarketingAddon\App\Models\EmailSetting;
class AcnooEmailSettingController extends Controller
{
public function index()
{
$businessId = auth()->user()->business_id;
$email_setting = EmailSetting::where('business_id', $businessId)->first() ?? new EmailSetting();
return view('marketingaddon::email-settings.index', compact('email_setting'));
}
public function store(Request $request)
{
$request->validate([
'driver' => 'required|string|max:25|in:smtp,sendmail',
'host' => 'nullable|string|max:255',
'port' => 'nullable|numeric',
'username' => 'nullable|string|max:255',
'password' => 'nullable|string|max:255',
'encryption' => 'nullable|string|max:25',
'from_name' => 'nullable|string|max:255',
'from_address' => 'nullable|string|max:255',
]);
EmailSetting::updateOrCreate(
['business_id' => auth()->user()->business_id],
$request->only(['driver', 'host', 'port', 'username', 'password', 'encryption', 'from_name', 'from_address'])
);
return response()->json(__('Email setting updated successfully.'));
}
}