Add TestEmailController and views for sending test emails
All checks were successful
Deploy Production (crewsportswear.com) / deploy (push) Successful in 2m51s

This commit is contained in:
Frank John Begornia
2026-02-26 22:46:14 +08:00
parent dfdb48920d
commit 47b354d8b7
4 changed files with 128 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test Email CREW Sportswear</title>
</head>
<body style="font-family: Arial, sans-serif; color: #333; padding: 20px;">
<h2 style="color: #d9534f;">CREW Sportswear Test Email</h2>
<p>This is a test email to verify that the mail configuration is working correctly.</p>
<p>Sent to: <strong>{{ $recipient }}</strong></p>
<hr>
<p style="font-size: 12px; color: #777;">
<strong>Mail Config Used:</strong><br>
Driver: {{ $config['driver'] }}<br>
Host: {{ $config['host'] }}<br>
Port: {{ $config['port'] }}<br>
Username: {{ $config['username'] }}<br>
Encryption: {{ $config['encryption'] }}
</p>
<hr>
<p style="font-size: 12px; color: #aaa;">This is an automated test message from CREW Sportswear.</p>
</body>
</html>

View File

@@ -0,0 +1,55 @@
@extends('layout.main')
@section('content')
<div class="row">
<div class="col-md-6 col-md-offset-3" style="margin-top: 40px; margin-bottom: 40px;">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong>Send Test Email</strong></h3>
</div>
<div class="panel-body">
@if (session('message'))
<div class="alert alert-{{ session('status') }} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
{{ session('message') }}
</div>
@endif
<!-- Mail Config Info -->
<div class="well well-sm" style="font-size: 12px;">
<strong>Current Mail Config</strong><br>
Driver: <code>{{ config('mail.driver') ?: '(not set)' }}</code><br>
Host: <code>{{ config('mail.host') ?: '(not set)' }}</code><br>
Port: <code>{{ config('mail.port') ?: '(not set)' }}</code><br>
Username: <code>{{ config('mail.username') ?: '(not set)' }}</code><br>
Encryption: <code>{{ config('mail.encryption') ?: '(not set)' }}</code>
</div>
<form method="POST" action="{{ url('test-email/send') }}">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('recipient') ? ' has-error' : '' }}">
<label for="recipient">Recipient Email</label>
<input type="email"
name="recipient"
id="recipient"
class="form-control"
placeholder="you@example.com"
value="{{ old('recipient') }}"
required>
@if ($errors->has('recipient'))
<span class="help-block">{{ $errors->first('recipient') }}</span>
@endif
</div>
<button type="submit" class="btn btn-primary btn-block">
<i class="fa fa-envelope"></i> Send Test Email
</button>
</form>
</div>
</div>
</div>
</div>
@endsection