Pipedrive + MailKite
Pipedrive is a sales-focused CRM. Use MailKite to receive inbound email as deals or activities — customer inquiries and lead responses land in your pipeline.
What you need
- A verified domain with SPF + DKIM published
- Your API key (
mk_live_…) - Pipedrive account with API token
Send email
Use MailKite SMTP for transactional email. Pipedrive handles replies within its deal activity tracking.
smtp-config
SMTP Host: smtp.mailkite.dev
SMTP Port: 587
SMTP Username: mailkite
SMTP Password: mk_live_...
From: hello@yourdomain.com Receive inbound email (optional)
Point your domain's webhook to this handler. Inbound email creates a Pipedrive deal with the email content as a note.
handle-inbound.ts
// Receive inbound email → create Pipedrive deal
const PIPEDRIVE_API = 'https://api.pipedrive.com/v1';
async function handleInbound(email) {
// Create a deal from inbound email
const res = await fetch(`${PIPEDRIVE_API}/deals?api_token=${process.env.PIPEDRIVE_API_TOKEN}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
title: email.subject || `Lead from ${email.from}`,
value: 0,
stage_id: parseInt(process.env.PIPEDRIVE_STAGE_ID),
}),
});
const deal = await res.json();
// Add a note with the email content
await fetch(`${PIPEDRIVE_API}/notes?api_token=${process.env.PIPEDRIVE_API_TOKEN}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
deal_id: deal.data.id,
content: `From: ${email.from}\nSubject: ${email.subject}\n\n${email.text}`,
}),
});
return deal;
} Test it
terminal
curl -X POST https://your-worker.example.com/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{"from":"lead@example.com","to":"sales@yourdomain.com","subject":"Interested in your product","text":"Tell me about pricing."}' Troubleshooting
- Pipedrive API token is per-user. Get it from Settings → Personal → API.
- You need a valid
stage_idfor the pipeline stage where new deals land. - Ensure the API token has write access to deals and notes.
See the SMTP relay docs for the full connection reference, or all integrations for other platforms.