Dynamic content

동적 콘텐츠

Swap parts of one message template to fit customer context.

···
html
<div class="mail"><div class="mailhead"><span>TO: CUSTOMER</span><b>EMAIL</b></div><h3>YOUR NEXT PICK</h3><div class="slot"><div class="tile"></div><div><small>PRODUCT SLOT</small><strong id="offer">WELCOME SET</strong><span id="group">NEW CUSTOMER</span></div></div><footer>ONE TEMPLATE · TWO AUDIENCES</footer></div>
css
.mail{width:min(84%,430px);border:2px solid var(--fg);background:var(--surface);font:800 clamp(10px,max(3.7vmin,1vw),16px)/1.2 sans-serif;box-shadow:clamp(4px,1vmin,9px) clamp(4px,1vmin,9px) 0 var(--line)}.mailhead{display:flex;justify-content:space-between;padding:clamp(7px,1.6vmin,14px);border-bottom:1px solid var(--line);font-size:max(10px,1vw,.8em)}.mailhead b{color:var(--accent)}.mail h3{font-size:clamp(14px,3vmin,27px);margin:clamp(9px,2vmin,18px)}.slot{display:flex;gap:clamp(8px,2vmin,18px);margin:0 clamp(9px,2vmin,18px);padding:clamp(8px,2vmin,17px);background:var(--bg);border:2px dashed var(--accent)}.tile{width:clamp(34px,8vmin,72px);aspect-ratio:1;flex:none;background:linear-gradient(135deg,var(--accent),var(--accent-2));animation:swap 3s infinite}.slot>div:last-child{display:grid;align-content:center;gap:4px}.slot small,.slot span{color:var(--muted);font-size:max(10px,1vw,.75em)}.slot strong{color:var(--accent)}.mail footer{padding:clamp(8px,1.8vmin,16px);font-size:max(10px,1vw,.7em);letter-spacing:.08em}@keyframes swap{0%,40%,100%{filter:hue-rotate(0deg);transform:scale(1)}55%,85%{filter:hue-rotate(65deg);transform:scale(.9)}}
js
const offer=document.querySelector('#offer'),group=document.querySelector('#group');let returning=false;setInterval(()=>{returning=!returning;offer.textContent=returning?'REFILL PICK':'WELCOME SET';group.textContent=returning?'RETURNING CUSTOMER':'NEW CUSTOMER'},3000);

Dynamic content swaps slots such as product, offer, or greeting inside a shared message template. It avoids rebuilding a whole campaign for every audience.

The demo alternates new-customer and returning-customer recommendation blocks inside one email frame. Prepare a sensible fallback when data is missing.

Check context and consent so personalization does not reveal information that feels too private.

When to use

Use it when a shared campaign needs customer-specific offers.

Open as page ↗