Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6ae9b9c1d | ||
|
|
28b8d27be7 | ||
|
|
d2e2ef9ece | ||
|
|
fdd5cd4573 | ||
|
|
9c7b3e69ad |
No files matched your search
+2
-2
@@ -12,7 +12,7 @@ metadata:
|
||||
title: Courier
|
||||
description: Transaktionsmail für deine Apps über Amazon SES.
|
||||
icon: https://git.aimighty.olares.de/aimighty/courier/raw/branch/main/icon.png
|
||||
version: 26.11.8
|
||||
version: 26.11.13
|
||||
categories:
|
||||
- Applications
|
||||
|
||||
@@ -106,7 +106,7 @@ envs:
|
||||
default: "1000"
|
||||
|
||||
spec:
|
||||
versionName: '26.11.8'
|
||||
versionName: '26.11.13'
|
||||
fullDescription: |
|
||||
**Courier** ist ein kleiner Versanddienst für transaktionale E-Mails:
|
||||
eine Resend-kompatible HTTP-API, Warteschlange, Retry, Logs und
|
||||
|
||||
@@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
|
||||
import {
|
||||
Ban,
|
||||
BarChart3,
|
||||
Calculator,
|
||||
BookOpen,
|
||||
Globe,
|
||||
KeyRound,
|
||||
@@ -35,6 +36,7 @@ const groups: { title: string; items: Item[] }[] = [
|
||||
title: "Betrieb",
|
||||
items: [
|
||||
{ href: "/metrics", label: "Metriken", icon: BarChart3 },
|
||||
{ href: "/pricing", label: "Preise", icon: Calculator },
|
||||
{ href: "/docs", label: "Dokumentation", icon: BookOpen },
|
||||
],
|
||||
},
|
||||
|
||||
+84
-49
@@ -42,18 +42,6 @@ export default async function Domains() {
|
||||
}
|
||||
/>
|
||||
|
||||
{!ses.production ? (
|
||||
<div className="ds-alert ds-alert--warning">
|
||||
<div>
|
||||
<p className="ds-alert__title">SES ist im Sandbox-Modus</p>
|
||||
<p className="ds-alert__text">
|
||||
{Math.round(ses.max24h)} Mails pro 24 Stunden, {ses.rate}/s. Für 500/Tag braucht das
|
||||
AWS-Konto Production Access.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{error ? (
|
||||
<div className="ds-alert ds-alert--danger" role="alert">
|
||||
<div>
|
||||
@@ -63,48 +51,95 @@ export default async function Domains() {
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{rows.length ? (
|
||||
<section className="ds-card app-panel">
|
||||
<div className="app-domain-list">
|
||||
{rows.map((row) => (
|
||||
<Link
|
||||
key={row.domain}
|
||||
className="app-domain-row"
|
||||
href={`/domains/${encodeURIComponent(row.domain)}`}
|
||||
>
|
||||
<span className="app-domain-row__icon" aria-hidden="true">
|
||||
<Globe />
|
||||
</span>
|
||||
<span className="app-domain-row__main">
|
||||
<span className="app-domain-row__name">
|
||||
{row.domain}
|
||||
{statusBadge(row.status)}
|
||||
<div className="app-grid app-grid--sidebar">
|
||||
{rows.length ? (
|
||||
<section className="ds-card app-panel" aria-labelledby="domain-list">
|
||||
<div className="app-panel__head">
|
||||
<h2 id="domain-list">Domains</h2>
|
||||
</div>
|
||||
<div className="app-domain-list">
|
||||
{rows.map((row) => (
|
||||
<Link
|
||||
key={row.domain}
|
||||
className="app-domain-row"
|
||||
href={`/domains/${encodeURIComponent(row.domain)}`}
|
||||
>
|
||||
<span className="app-domain-row__icon" aria-hidden="true">
|
||||
<Globe />
|
||||
</span>
|
||||
<span className="app-domain-row__meta">
|
||||
<span>{row.dkim_tokens?.length ? `${row.dkim_tokens.length} DKIM-Tokens` : "keine DKIM-Tokens"}</span>
|
||||
<span className="app-mono">{row.mail_from_domain || "kein MAIL FROM"}</span>
|
||||
<span title={datum(row.last_checked_at)}>
|
||||
geprüft {row.last_checked_at ? relativ(row.last_checked_at) : "–"}
|
||||
<span className="app-domain-row__main">
|
||||
<span className="app-domain-row__name">{row.domain}</span>
|
||||
<span className="app-domain-row__meta">
|
||||
<span>
|
||||
{row.dkim_tokens?.length
|
||||
? `${row.dkim_tokens.length} DKIM-Tokens`
|
||||
: "keine DKIM-Tokens"}
|
||||
</span>
|
||||
<span className="app-mono">{row.mail_from_domain || "kein MAIL FROM"}</span>
|
||||
<span title={datum(row.last_checked_at)}>
|
||||
geprüft {row.last_checked_at ? relativ(row.last_checked_at) : "–"}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<ChevronRight className="app-domain-row__chevron" aria-hidden="true" />
|
||||
<span className="app-domain-row__side">
|
||||
{statusBadge(row.status)}
|
||||
<ChevronRight className="app-domain-row__chevron" aria-hidden="true" />
|
||||
</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
) : (
|
||||
<EmptyState
|
||||
icon={Globe}
|
||||
title="Noch keine Domains"
|
||||
text="Füge eine Domain hinzu, verifiziere sie mit den angezeigten DNS-Records und lege danach einen API-Key an."
|
||||
action={
|
||||
<Link className="ds-button ds-button--sm" href="/domains/new">
|
||||
Domain hinzufügen
|
||||
</Link>
|
||||
))}
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
<aside className="ds-card app-panel" aria-labelledby="ses-konto">
|
||||
<div className="app-panel__head">
|
||||
<h2 id="ses-konto">SES-Konto</h2>
|
||||
{ses.production ? (
|
||||
<span className="ds-badge ds-badge--success">Production</span>
|
||||
) : (
|
||||
<span className="ds-badge ds-badge--warning">Sandbox</span>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
) : (
|
||||
<EmptyState
|
||||
icon={Globe}
|
||||
title="Noch keine Domains"
|
||||
text="Füge eine Domain hinzu, verifiziere sie mit den angezeigten DNS-Records und lege danach einen API-Key an."
|
||||
action={
|
||||
<Link className="ds-button ds-button--sm" href="/domains/new">
|
||||
Domain hinzufügen
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<dl className="app-dl">
|
||||
<dt>Tagesquote</dt>
|
||||
<dd>{Math.round(ses.max24h)} Mails</dd>
|
||||
<dt>Rate</dt>
|
||||
<dd>{ses.rate}/s</dd>
|
||||
<dt>Region</dt>
|
||||
<dd className="app-mono">eu-west-1</dd>
|
||||
</dl>
|
||||
|
||||
{!ses.production ? (
|
||||
<div className="ds-alert ds-alert--warning">
|
||||
<div>
|
||||
<p className="ds-alert__title">Sandbox aktiv</p>
|
||||
<p className="ds-alert__text">
|
||||
Für 500/Tag braucht das AWS-Konto Production Access. Bis dahin nur verifizierte
|
||||
Empfänger.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<h2 className="app-section">So funktioniert's</h2>
|
||||
<ol className="app-steps">
|
||||
<li>Domain anlegen und die DNS-Records setzen.</li>
|
||||
<li>Status prüfen, bis DKIM und SES „Verifiziert“ melden.</li>
|
||||
<li>API-Key mit dieser Domain erzeugen.</li>
|
||||
</ol>
|
||||
</aside>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
+216
@@ -1008,3 +1008,219 @@ body {
|
||||
margin-top: var(--ds-space-2);
|
||||
}
|
||||
}
|
||||
|
||||
.app-domain-row__side {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--ds-space-2);
|
||||
margin-inline-start: auto;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.app-steps {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--ds-space-2);
|
||||
margin: 0;
|
||||
padding-inline-start: var(--ds-space-4);
|
||||
color: var(--ds-text-muted);
|
||||
font-size: var(--ds-text-sm);
|
||||
}
|
||||
|
||||
.app-domain-row__side .app-domain-row__chevron {
|
||||
margin-inline-start: 0;
|
||||
}
|
||||
|
||||
/* Sidebar-Feinschliff */
|
||||
.app-sidebar__top {
|
||||
gap: var(--ds-space-4);
|
||||
}
|
||||
|
||||
.app-sidebar .app-brand {
|
||||
font-size: var(--ds-text-lg);
|
||||
}
|
||||
|
||||
.app-nav--sidebar {
|
||||
gap: var(--ds-space-3);
|
||||
}
|
||||
|
||||
.app-nav__title {
|
||||
font-size: var(--ds-text-2xs);
|
||||
letter-spacing: 0.1em;
|
||||
opacity: 0.52;
|
||||
}
|
||||
|
||||
.app-nav__group + .app-nav__group {
|
||||
padding-top: var(--ds-space-3);
|
||||
border-top: var(--ds-border-thin) solid color-mix(in srgb, currentColor 14%, transparent);
|
||||
}
|
||||
|
||||
.app-nav__link:hover {
|
||||
background: color-mix(in srgb, currentColor 9%, transparent);
|
||||
}
|
||||
|
||||
.app-nav__link[aria-current="page"]:hover {
|
||||
background: var(--ds-selection-bg);
|
||||
}
|
||||
|
||||
.app-sidebar__status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--ds-space-2);
|
||||
padding-inline: var(--ds-space-3);
|
||||
color: inherit;
|
||||
font-size: var(--ds-text-xs);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.app-sidebar__dot {
|
||||
width: var(--ds-space-2);
|
||||
height: var(--ds-space-2);
|
||||
border-radius: var(--ds-radius-full);
|
||||
background: var(--ds-success);
|
||||
}
|
||||
|
||||
/* Aktiver Eintrag: ruhiger als die volle Goldfläche */
|
||||
.app-nav--sidebar .app-nav__link {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.app-nav--sidebar .app-nav__link[aria-current="page"] {
|
||||
background: color-mix(in srgb, var(--ds-selection-bg) 22%, transparent);
|
||||
color: var(--ds-link);
|
||||
}
|
||||
|
||||
.app-nav--sidebar .app-nav__link[aria-current="page"]::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: var(--ds-space-2);
|
||||
bottom: var(--ds-space-2);
|
||||
left: 0;
|
||||
width: var(--ds-space-1);
|
||||
border-radius: var(--ds-radius-full);
|
||||
background: var(--ds-link);
|
||||
}
|
||||
|
||||
.app-nav--sidebar .app-nav__link[aria-current="page"] {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.app-nav--sidebar .app-nav__link[aria-current="page"]:hover {
|
||||
background: color-mix(in srgb, currentColor 9%, transparent);
|
||||
}
|
||||
|
||||
/* Link-Zustände in der Sidebar: nie von globalem a:hover/a:visited überschreiben lassen */
|
||||
a.app-nav__link,
|
||||
a.app-nav__link:visited {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a.app-nav__link:hover {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.app-nav--sidebar a.app-nav__link[aria-current="page"],
|
||||
.app-nav--sidebar a.app-nav__link[aria-current="page"]:hover {
|
||||
color: var(--ds-link);
|
||||
}
|
||||
|
||||
.app-nav--mobile a.app-nav__link[aria-current="page"],
|
||||
.app-nav--mobile a.app-nav__link[aria-current="page"]:hover {
|
||||
color: var(--ds-selection-text);
|
||||
}
|
||||
|
||||
/* Preise */
|
||||
.app-toolbar--pricing {
|
||||
grid-template-columns: minmax(12rem, 20rem) auto;
|
||||
}
|
||||
|
||||
@media (max-width: 63.99rem) {
|
||||
.app-toolbar--pricing {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.app-plan-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
|
||||
gap: var(--ds-space-4);
|
||||
}
|
||||
|
||||
.app-plan {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--ds-space-2);
|
||||
}
|
||||
|
||||
.app-plan__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--ds-space-2);
|
||||
}
|
||||
|
||||
.app-plan__head h2 {
|
||||
margin: 0;
|
||||
font-size: var(--ds-text-lg);
|
||||
}
|
||||
|
||||
.app-plan__cost {
|
||||
margin-top: var(--ds-space-2);
|
||||
}
|
||||
|
||||
.app-plan__price {
|
||||
color: var(--ds-text-muted);
|
||||
font-size: var(--ds-text-sm);
|
||||
}
|
||||
|
||||
.app-plan__note {
|
||||
margin: 0;
|
||||
color: var(--ds-text-muted);
|
||||
font-size: var(--ds-text-sm);
|
||||
}
|
||||
|
||||
.app-plan__conditions {
|
||||
margin: 0;
|
||||
padding-inline-start: var(--ds-space-4);
|
||||
color: var(--ds-text-subtle);
|
||||
font-size: var(--ds-text-xs);
|
||||
}
|
||||
|
||||
/* Preisrechner: Eingabe und Button auf einer Linie */
|
||||
.app-calc {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: var(--ds-space-6);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.app-calc__form {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: var(--ds-space-3);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.app-calc__result {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: var(--ds-space-1);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.app-calc__value {
|
||||
font-size: var(--ds-text-3xl);
|
||||
}
|
||||
|
||||
@media (max-width: 63.99rem) {
|
||||
.app-calc {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.app-calc__result {
|
||||
align-items: flex-start;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
||||
<AppNav />
|
||||
</div>
|
||||
<div className="app-sidebar__footer">
|
||||
<div className="app-sidebar__status">
|
||||
<span className="app-sidebar__dot" aria-hidden="true" />
|
||||
Amazon SES
|
||||
</div>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
import Link from "next/link";
|
||||
import { Calculator } from "lucide-react";
|
||||
|
||||
import { PageHeader } from "@/app/page-header";
|
||||
import { monthlyVolume } from "@/lib/queries";
|
||||
import { SES_PLANS, estimateMonthly, usd } from "@/lib/pricing";
|
||||
import { sesAccountStatus } from "@/lib/ses-admin";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Pricing({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ volume?: string }>;
|
||||
}) {
|
||||
const params = await searchParams;
|
||||
const requested = Number(params.volume);
|
||||
const volume = Number.isFinite(requested) && requested > 0 ? Math.floor(requested) : 15000;
|
||||
|
||||
let usage = { month: 0, last30: 0 };
|
||||
let ses = { production: false, max24h: 0, rate: 0 };
|
||||
try {
|
||||
[usage, ses] = await Promise.all([monthlyVolume(), sesAccountStatus()]);
|
||||
} catch {
|
||||
// Die Preisliste funktioniert auch ohne Datenbank.
|
||||
}
|
||||
|
||||
const plans = SES_PLANS.map((plan) => ({ plan, cost: estimateMonthly(plan, volume) })).sort(
|
||||
(a, b) => a.cost - b.cost,
|
||||
);
|
||||
const cheapest = plans[0];
|
||||
const daysInMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).getDate();
|
||||
const projected = usage.month
|
||||
? Math.round((usage.month / new Date().getDate()) * daysInMonth)
|
||||
: 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title="Preise"
|
||||
lead="Was Amazon SES bei deinem Volumen kostet – AWS-Listenpreise, keine Schätzung aus Marketingmaterial."
|
||||
/>
|
||||
|
||||
<section className="app-stats" aria-label="Preis-Kennzahlen">
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{usage.month}</span>
|
||||
<span className="ds-stat__label">Mails diesen Monat</span>
|
||||
<span className="ds-stat__meta">
|
||||
Hochrechnung: {projected} / Monat
|
||||
</span>
|
||||
</article>
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{volume.toLocaleString("de-DE")}</span>
|
||||
<span className="ds-stat__label">Beispielvolumen</span>
|
||||
<span className="ds-stat__meta">entspricht 500 Mails/Tag</span>
|
||||
</article>
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{usd(cheapest.cost)}</span>
|
||||
<span className="ds-stat__label">Günstigster Plan</span>
|
||||
<span className="ds-stat__meta">{cheapest.plan.name} bei diesem Volumen</span>
|
||||
</article>
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{ses.production ? "Production" : "Sandbox"}</span>
|
||||
<span className="ds-stat__label">SES-Status</span>
|
||||
<span className="ds-stat__meta">
|
||||
{Math.round(ses.max24h)} Mails/Tag · {ses.rate}/s
|
||||
</span>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section className="ds-card app-panel" aria-labelledby="rechner">
|
||||
<div className="app-panel__head">
|
||||
<div>
|
||||
<h2 id="rechner">Kostenrechner</h2>
|
||||
<p className="app-muted">AWS-Listenpreise für eu-west-1, ohne Steuern.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="app-calc">
|
||||
<form className="app-calc__form" method="get">
|
||||
<div className="ds-field">
|
||||
<label className="ds-field__label" htmlFor="volume">
|
||||
Mails pro Monat
|
||||
</label>
|
||||
<input
|
||||
className="ds-input"
|
||||
id="volume"
|
||||
name="volume"
|
||||
type="number"
|
||||
min={1}
|
||||
step={1000}
|
||||
defaultValue={volume}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div className="app-toolbar__actions">
|
||||
<button className="ds-button" type="submit">
|
||||
<Calculator className="app-nav__icon" aria-hidden="true" />
|
||||
Berechnen
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div className="app-calc__result">
|
||||
<span className="ds-stat__label">Günstigster Plan bei {volume.toLocaleString("de-DE")} Mails</span>
|
||||
<span className="ds-stat__value app-calc__value">{usd(cheapest.cost)}</span>
|
||||
<span className="app-muted">{cheapest.plan.name}</span>
|
||||
</div>
|
||||
</div>
|
||||
<p className="ds-field__hint app-section">Standard: 15.000 (500/Tag).</p>
|
||||
</section>
|
||||
|
||||
<section className="app-plan-grid app-section" aria-label="SES-Preispläne">
|
||||
{plans.map(({ plan, cost }) => (
|
||||
<article className="ds-card app-plan" key={plan.id}>
|
||||
<div className="app-plan__head">
|
||||
<h2>{plan.name}</h2>
|
||||
{plan.id === cheapest.plan.id ? (
|
||||
<span className="ds-badge ds-badge--success">Günstigster</span>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="ds-stat__value app-plan__cost">{usd(cost)}</span>
|
||||
<span className="app-plan__price">
|
||||
{plan.base ? `${usd(plan.base)}/Monat + ` : "keine Grundgebühr + "}
|
||||
{usd(plan.tiers[0].rate)}/1.000
|
||||
</span>
|
||||
<p className="app-plan__note">{plan.note}</p>
|
||||
<ul className="app-plan__conditions">
|
||||
<li>0–10 Mio.: {usd(plan.tiers[0].rate)}/1.000</li>
|
||||
{plan.tiers[1] ? (
|
||||
<li>10–100 Mio.: {usd(plan.tiers[1].rate)}/1.000</li>
|
||||
) : null}
|
||||
{plan.tiers[2] ? <li>> 100 Mio.: {usd(plan.tiers[2].rate)}/1.000</li> : null}
|
||||
</ul>
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
|
||||
<div className="ds-alert app-section">
|
||||
<div>
|
||||
<p className="ds-alert__title">Was in der Schätzung fehlt</p>
|
||||
<p className="ds-alert__text">
|
||||
Steuern, Datenübertragung für Anhänge ($0,12/GB), Dedicated IPs und SNS-Kosten sind
|
||||
nicht enthalten. Neue SES-Konten starten häufig auf <strong>Essentials</strong>; der
|
||||
Wechsel zu À la carte ist möglich. Preisstand: 23.11.2026, Quelle AWS SES Pricing.
|
||||
</p>
|
||||
<p className="ds-alert__text">
|
||||
<a href="https://aws.amazon.com/ses/pricing/" target="_blank" rel="noreferrer">
|
||||
AWS SES Preise öffnen
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
export type SesPlan = {
|
||||
id: string;
|
||||
name: string;
|
||||
base: number;
|
||||
tiers: { upTo: number | null; rate: number }[];
|
||||
note: string;
|
||||
};
|
||||
|
||||
export const SES_PLANS: SesPlan[] = [
|
||||
{
|
||||
id: "a-la-carte",
|
||||
name: "À la carte",
|
||||
base: 0,
|
||||
tiers: [{ upTo: null, rate: 0.1 }],
|
||||
note: "Pay-as-you-go, keine Grundgebühr.",
|
||||
},
|
||||
{
|
||||
id: "essentials",
|
||||
name: "Essentials",
|
||||
base: 0,
|
||||
tiers: [
|
||||
{ upTo: 10_000_000, rate: 0.16 },
|
||||
{ upTo: 100_000_000, rate: 0.14 },
|
||||
{ upTo: null, rate: 0.11 },
|
||||
],
|
||||
note: "Standard für neue SES-Konten, ohne Grundgebühr.",
|
||||
},
|
||||
{
|
||||
id: "pro",
|
||||
name: "Pro",
|
||||
base: 105,
|
||||
tiers: [
|
||||
{ upTo: 10_000_000, rate: 0.22 },
|
||||
{ upTo: 100_000_000, rate: 0.17 },
|
||||
{ upTo: null, rate: 0.12 },
|
||||
],
|
||||
note: "Mit Dedicated IPs und erweiterten Deliverability-Funktionen.",
|
||||
},
|
||||
{
|
||||
id: "enterprise",
|
||||
name: "Enterprise",
|
||||
base: 500,
|
||||
tiers: [
|
||||
{ upTo: 10_000_000, rate: 0.23 },
|
||||
{ upTo: 100_000_000, rate: 0.18 },
|
||||
{ upTo: null, rate: 0.13 },
|
||||
],
|
||||
note: "Mehrere Domains, viele Dedicated IPs und Seedlist-Tests.",
|
||||
},
|
||||
];
|
||||
|
||||
export function estimateMonthly(plan: SesPlan, volume: number): number {
|
||||
let remaining = Math.max(0, Math.floor(volume));
|
||||
let last = 0;
|
||||
let cost = plan.base;
|
||||
for (const tier of plan.tiers) {
|
||||
const limit = tier.upTo === null ? remaining : Math.min(remaining, tier.upTo - last);
|
||||
if (limit <= 0) break;
|
||||
cost += (limit / 1000) * tier.rate;
|
||||
remaining -= limit;
|
||||
last = tier.upTo ?? last;
|
||||
if (remaining <= 0) break;
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
||||
export function usd(value: number): string {
|
||||
return new Intl.NumberFormat("de-DE", {
|
||||
style: "currency",
|
||||
currency: "USD",
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}).format(value);
|
||||
}
|
||||
@@ -178,3 +178,13 @@ export async function dailyMetrics(days = 14, keyId = ""): Promise<DailyMetric[]
|
||||
);
|
||||
return rows;
|
||||
}
|
||||
|
||||
export async function monthlyVolume(): Promise<{ month: number; last30: number }> {
|
||||
const { rows } = await query<{ month: number; last30: number }>(
|
||||
`select
|
||||
count(*) filter (where created_at >= date_trunc('month', now()))::int as month,
|
||||
count(*) filter (where created_at >= now() - interval '30 days')::int as last30
|
||||
from messages`,
|
||||
);
|
||||
return rows[0] ?? { month: 0, last30: 0 };
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@ apiVersion: v2
|
||||
name: courier
|
||||
description: Transaktionsmail-Gateway für hubsport.club über Amazon SES.
|
||||
type: application
|
||||
version: 26.11.8
|
||||
appVersion: "26.11.8"
|
||||
version: 26.11.13
|
||||
appVersion: "26.11.13"
|
||||
icon: https://git.aimighty.olares.de/aimighty/courier/raw/branch/main/icon.png
|
||||
home: https://git.aimighty.olares.de/aimighty/courier
|
||||
@@ -12,7 +12,7 @@ metadata:
|
||||
title: Courier
|
||||
description: Transaktionsmail für deine Apps über Amazon SES.
|
||||
icon: https://git.aimighty.olares.de/aimighty/courier/raw/branch/main/icon.png
|
||||
version: 26.11.8
|
||||
version: 26.11.13
|
||||
categories:
|
||||
- Applications
|
||||
|
||||
@@ -106,7 +106,7 @@ envs:
|
||||
default: "1000"
|
||||
|
||||
spec:
|
||||
versionName: '26.11.8'
|
||||
versionName: '26.11.13'
|
||||
fullDescription: |
|
||||
**Courier** ist ein kleiner Versanddienst für transaktionale E-Mails:
|
||||
eine Resend-kompatible HTTP-API, Warteschlange, Retry, Logs und
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "courier",
|
||||
"version": "26.11.8",
|
||||
"version": "26.11.13",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -H 0.0.0.0 -p 3400",
|
||||
|
||||
Reference in new issue
Block a user