<?php
|
if (!defined('ABSPATH')) {
|
exit; // Exit if accessed directly
|
}
|
/**
|
* Template for notification digest emails
|
* Variables available:
|
* $user - WP_User object
|
* $frequency - 'daily', 'weekly', or 'monthly'
|
* $grouped_notifications - Array of notifications grouped by type
|
*/
|
?>
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<style>
|
/* Email-safe styles */
|
body {
|
font-family: Courier, monospace;
|
line-height: 1.6;
|
color: #1B1B1B;
|
background: #EFEFEF;
|
margin: 0;
|
padding: 0;
|
}
|
.container {
|
max-width: 600px;
|
margin: 0 auto;
|
padding: 20px;
|
background: #FFFFFF;
|
}
|
.header {
|
text-align: center;
|
margin-bottom: 30px;
|
border-bottom: 2px solid #FF0080;
|
padding-bottom: 20px;
|
}
|
.header h1 {
|
font-family: Impact, Arial Black, sans-serif;
|
font-size: 24px;
|
color: #1B1B1B;
|
text-transform: uppercase;
|
margin: 0;
|
}
|
.intro {
|
font-style: italic;
|
margin-bottom: 30px;
|
padding: 15px;
|
background: #EFEFEF;
|
border-left: 4px solid #FF0080;
|
}
|
.section {
|
margin-bottom: 30px;
|
padding: 15px;
|
border: 1px solid #EFEFEF;
|
}
|
.section-title {
|
font-family: Impact, Arial Black, sans-serif;
|
text-transform: uppercase;
|
color: #FF0080;
|
margin: 0 0 15px 0;
|
padding-bottom: 5px;
|
border-bottom: 1px solid #EFEFEF;
|
}
|
.notification {
|
margin-bottom: 15px;
|
padding-left: 10px;
|
border-left: 2px solid #FF0080;
|
}
|
.notification:last-child {
|
margin-bottom: 0;
|
}
|
.timestamp {
|
color: #666666;
|
font-size: 12px;
|
font-style: italic;
|
}
|
.cta {
|
text-align: center;
|
margin: 30px 0;
|
}
|
.button {
|
display: inline-block;
|
padding: 10px 20px;
|
background: #FF0080;
|
color: #FFFFFF;
|
text-decoration: none;
|
text-transform: uppercase;
|
font-family: Impact, Arial Black, sans-serif;
|
}
|
.footer {
|
margin-top: 30px;
|
padding-top: 20px;
|
border-top: 2px solid #FF0080;
|
font-size: 12px;
|
color: #666666;
|
text-align: center;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="container">
|
<div class="header">
|
<h1>
|
<?php
|
switch($frequency) {
|
case 'daily':
|
echo "TODAY'S INK DROP";
|
break;
|
case 'weekly':
|
echo "THIS WEEK'S SCENE REPORT";
|
break;
|
case 'monthly':
|
echo "MONTHLY INK ROUNDUP";
|
break;
|
}
|
?>
|
</h1>
|
</div>
|
|
<div class="intro">
|
Hey <?= esc_html($user->display_name) ?>,
|
<?php
|
switch($frequency) {
|
case 'daily':
|
echo "Here's what went down in the last 24 hours.";
|
break;
|
case 'weekly':
|
echo "Your weekly dose of Edmonton's ink scene shenanigans.";
|
break;
|
case 'monthly':
|
echo "Another month of rad art and awesome artists - let's dive in.";
|
break;
|
}
|
?>
|
</div>
|
|
<?php foreach ($grouped_notifications as $type => $notifications): ?>
|
<div class="section">
|
<h2 class="section-title">
|
<?php
|
switch($type) {
|
case 'artist_new_tattoo':
|
echo "FRESH INK ↯";
|
break;
|
case 'artist_new_artwork':
|
echo "NEW ART DROPS ⚡";
|
break;
|
case 'shop_update':
|
echo "SHOP TALK";
|
break;
|
default:
|
echo "SCENE NEWS";
|
}
|
?>
|
</h2>
|
|
<?php foreach ($notifications as $notification): ?>
|
<div class="notification">
|
<?= wp_kses_post($notification['message']) ?>
|
<div class="timestamp">
|
<?= human_time_diff(strtotime($notification['created']), current_time('timestamp')) ?> ago
|
</div>
|
</div>
|
<?php endforeach; ?>
|
</div>
|
<?php endforeach; ?>
|
|
<div class="cta">
|
<a href="<?= home_url('/dash/notifications') ?>" class="button">
|
CHECK THE FULL STORY →
|
</a>
|
</div>
|
|
<div class="footer">
|
<p>
|
You're getting this because you signed up for <?= $frequency ?> updates.
|
<a href="<?= home_url('/dash/settings') ?>">Change your settings</a> if that's not your jam.
|
</p>
|
<p>
|
Made with ♡ by your friendly neighborhood laser nerds<br>
|
© <?= date('Y') ?> edmonton.ink
|
</p>
|
<?php if($frequency !== 'daily'): ?>
|
<p><small>Miss something? We post daily too - just saying.</small></p>
|
<?php endif; ?>
|
</div>
|
</div>
|
</body>
|
</html>
|