themes-magazine-bold/email_wrapper.templ
Alex Dunmow fe754f634b initial: theme plugin magazine-bold
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/magazine-bold.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:38 +08:00

84 lines
3.7 KiB
Plaintext

package main
import (
"fmt"
"git.dev.alexdunmow.com/block/core/templates"
)
// magazineBoldEmailTemplate is the 600px paper-toned editorial email wrapper.
// It uses inlined hex defaults that map onto the paper-pink light preset so the
// layout reads correctly in clients that strip server CSS.
templ magazineBoldEmailTemplate(emailCtx templates.EmailContext, body string) {
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="x-apple-disable-message-reformatting"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>{ emailCtx.SiteSettings.SiteName }</title>
<style type="text/css">
body, table, td, p, a, li, blockquote { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
img { -ms-interpolation-mode: bicubic; border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
body { margin: 0 !important; padding: 0 !important; width: 100% !important; }
@media only screen and (max-width: 620px) {
.mb-email-container { width: 100% !important; max-width: 100% !important; }
.mb-email-pad { padding-left: 24px !important; padding-right: 24px !important; }
}
</style>
</head>
<body style={ mbEmailStyleBody(emailCtx) }>
if emailCtx.PreviewText != "" {
<div style="display:none;max-height:0;overflow:hidden;mso-hide:all;">
{ emailCtx.PreviewText }
</div>
}
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" style={ fmt.Sprintf("padding: 48px 10px; background-color: %s;", mbEmailBg(emailCtx)) }>
<table role="presentation" class="mb-email-container" width="600" cellspacing="0" cellpadding="0" border="0" style={ fmt.Sprintf("max-width: 600px; background-color: %s; border: 1px solid %s;", mbEmailCard(emailCtx), mbEmailBorder(emailCtx)) }>
<!-- Wordmark / masthead -->
<tr>
<td align="left" class="mb-email-pad" style={ mbEmailStyleHeader(emailCtx) }>
if emailCtx.SiteSettings.LogoURL != "" {
<img src={ emailCtx.SiteSettings.LogoURL } alt={ emailCtx.SiteSettings.SiteName } style="max-height:48px;width:auto;display:block;"/>
} else if emailCtx.SiteSettings.SiteName != "" {
<h1 style={ mbEmailStyleWordmark(emailCtx) }>{ emailCtx.SiteSettings.SiteName }</h1>
}
</td>
</tr>
<!-- Ink hairline -->
<tr>
<td style={ fmt.Sprintf("height: 1px; line-height: 1px; background-color: %s;", mbEmailFg(emailCtx)) }>&nbsp;</td>
</tr>
<!-- Body -->
<tr>
<td class="mb-email-pad" style={ mbEmailStyleBodyContent(emailCtx) }>
@templ.Raw(body)
</td>
</tr>
<!-- Mono colophon -->
<tr>
<td class="mb-email-pad" style={ mbEmailStyleColophon(emailCtx) }>
<div>{ emailCtx.SiteSettings.SiteName }</div>
if emailCtx.SiteSettings.SiteURL != "" {
<div style="margin-top:8px;">
<a href={ templ.SafeURL(emailCtx.SiteSettings.SiteURL) } style={ fmt.Sprintf("color: %s; text-decoration: underline;", mbEmailMutedFg(emailCtx)) }>{ emailCtx.SiteSettings.SiteURL }</a>
</div>
}
if emailCtx.UnsubscribeURL != "" {
<div style="margin-top:8px;">
<a href={ templ.SafeURL(emailCtx.UnsubscribeURL) } style={ fmt.Sprintf("color: %s; text-decoration: underline;", mbEmailMutedFg(emailCtx)) }>Unsubscribe</a>
</div>
}
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
}