Skip to content

Commit

Permalink
format files
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed May 24, 2024
1 parent 180ba1f commit afd6f14
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 74 deletions.
24 changes: 12 additions & 12 deletions src/controllers/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ public function __construct()
*/
private function sendResetEmail(string $email, string $resetLink): void
{
$subject = "Reset Your Password | Steamy Sips";
$subject = "Reset Your Password | Steamy Sips";

// Capture the HTML template content
ob_start();
$userEmail = $email;
require __DIR__ . '/../views/mails/PasswordReset.php';
$htmlMessage = ob_get_clean();
// Capture the HTML template content
ob_start();
$userEmail = $email;
require __DIR__ . '/../views/mails/PasswordReset.php';
$htmlMessage = ob_get_clean();

// Plain message as fallback
$plainMessage = "Click the link below to reset your password:\n$resetLink";
// Plain message as fallback
$plainMessage = "Click the link below to reset your password:\n$resetLink";

// Send the email
$mailer = new Mailer();
$mailer->sendMail($email, $subject, $htmlMessage, $plainMessage);
// Send the email
$mailer = new Mailer();
$mailer->sendMail($email, $subject, $htmlMessage, $plainMessage);
}

/**
* Invoked when user submits an email on form.
* @throws Exception Email could not be sent
Expand Down
133 changes: 71 additions & 62 deletions src/views/mails/PasswordReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,71 +19,80 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reset Your Password</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
color: #333;
line-height: 1.6;
margin: 0;
padding: 0;
}
.container {
width: 100%;
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border: 1px solid #ddd;
}
.header {
text-align: center;
padding: 10px 0;
border-bottom: 1px solid #ddd;
}
.header img {
max-width: 100px;
}
.content {
padding: 20px;
}
.footer {
text-align: center;
padding: 10px 0;
border-top: 1px solid #ddd;
font-size: 0.9em;
color: #999;
}
.button {
display: inline-block;
padding: 10px 20px;
margin: 20px 0;
font-size: 16px;
color: #fff;
background-color: #007bff;
text-decoration: none;
border-radius: 5px;
}
.button:hover {
background-color: #0056b3;
}
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
color: #333;
line-height: 1.6;
margin: 0;
padding: 0;
}

.container {
width: 100%;
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border: 1px solid #ddd;
}

.header {
text-align: center;
padding: 10px 0;
border-bottom: 1px solid #ddd;
}

.header img {
max-width: 100px;
}

.content {
padding: 20px;
}

.footer {
text-align: center;
padding: 10px 0;
border-top: 1px solid #ddd;
font-size: 0.9em;
color: #999;
}

.button {
display: inline-block;
padding: 10px 20px;
margin: 20px 0;
font-size: 16px;
color: #fff;
background-color: #007bff;
text-decoration: none;
border-radius: 5px;
}

.button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<img src="cid:logo" alt="Steamy Sips Logo">
</div>
<div class="content">
<h1>Reset Your Password</h1>
<p>Hello,</p>
<p>We received a request to reset the password for the account associated with <?= htmlspecialchars($userEmail) ?>. Click the button below to reset your password:</p>
<p><a href="<?= htmlspecialchars($resetLink) ?>" class="button">Reset My Password</a></p>
<p>If you did not request a password reset, please ignore this email. This link will expire in 24 hours.</p>
<p>Thank you,<br>The Steamy Sips Team</p>
</div>
<div class="footer">
<p>&copy; <?= date('Y') ?> Steamy Sips. All rights reserved.</p>
</div>
<div class="container">
<div class="header">
<img src="cid:logo" alt="Steamy Sips Logo">
</div>
<div class="content">
<h1>Reset Your Password</h1>
<p>Hello,</p>
<p>We received a request to reset the password for the account associated with <?= htmlspecialchars(
$userEmail
) ?>. Click the button below to reset your password:</p>
<p><a href="<?= htmlspecialchars($resetLink) ?>" class="button">Reset My Password</a></p>
<p>If you did not request a password reset, please ignore this email. This link will expire in 24 hours.</p>
<p>Thank you,<br>The Steamy Sips Team</p>
</div>
<div class="footer">
<p>&copy; <?= date('Y') ?> Steamy Sips. All rights reserved.</p>
</div>
</div>
</body>
</html>

0 comments on commit afd6f14

Please sign in to comment.