Passo-a-passo detalhado do skill, referenciando as fases cognitivas:
1SENSE — Identificar provider e tipo
Volume < 3K/mês → Resend (gratuito, melhor DX)
Volume > 100K/mês → SendGrid ou AWS SES
Verificar se domínio tem DKIM/SPF: `nslookup -type=TXT domainname.com`
2RECOMMEND — Template com React Email
```typescript
// emails/welcome.tsx
import { Button, Html, Body, Heading, Text, Container } from '@react-email/components';
interface WelcomeEmailProps {
name: string;
confirmUrl: string;
}
export function WelcomeEmail({ name, confirmUrl }: WelcomeEmailProps) {
return (
<Html lang="pt-BR">
<Body style={{ backgroundColor: '#f5f5f5', fontFamily: 'Arial, sans-serif' }}>
<Container style={{ maxWidth: '600px', margin: '0 auto', backgroundColor: '#fff', padding: '32px', borderRadius: '8px' }}>
<Heading style={{ color: '#1a1a1a', fontSize: '24px' }}>
Bem-vindo ao Synaptic Skills, {name}!
</Heading>
<Text style={{ color: '#555', lineHeight: '1.6' }}>
Confirme seu email para ativar sua conta e começar a usar a plataforma.
</Text>
<Button href={confirmUrl} style={{ backgroundColor: '#6366f1', color: '#fff', padding: '12px 24px', borderRadius: '6px', textDecoration: 'none' }}>
Confirmar Email
</Button>
<Text style={{ fontSize: '12px', color: '#999', marginTop: '32px' }}>
Se você não criou uma conta, ignore este email.
</Text>
</Container>
</Body>
</Html>
);
}
```
3RECOMMEND — Envio com Resend
```typescript
// lib/email.ts
import { Resend } from 'resend';
import { render } from '@react-email/render';
import { WelcomeEmail } from '../emails/welcome';
const resend = new Resend(process.env.RESEND_API_KEY);
export async function sendWelcomeEmail(to: string, name: string, confirmUrl: string) {
const html = await render(<WelcomeEmail name={name} confirmUrl={confirmUrl} />);
const { data, error } = await resend.emails.send({
from: 'Synaptic Skills <noreply@synapticskills.ai>',
to,
subject: `Bem-vindo, ${name}! Confirme seu email`,
html,
});
if (error) throw new Error(`Email send failed: ${error.message}`);
return data;
}
```
4RECOMMEND — Queue com retry (BullMQ)
```typescript
// Queue para emails com retry automático
emailQueue.add('welcome', { to, name, confirmUrl }, {
attempts: 5,
backoff: { type: 'exponential', delay: 60_000 }, // 1min, 2min, 4min, 8min, 16min
removeOnComplete: true,
});
```
5EVALUATE — Verificar deliverability
```bash
# Testar score de spam (deve ser > 9/10)
curl -X POST https://www.mail-tester.com/submission -d "email=test@mail-tester.com"
# Verificar headers DKIM/DMARC
nslookup -type=TXT _dmarc.synapticskills.ai
```
6REFLECT — Monitorar e documentar
Configurar webhook de bounces no Resend/SendGrid para remover emails inválidos
Monitorar bounce rate no dashboard (alerta > 2%)
Reportar telemetria via mcp-skillschain