เริ่มต้นที่นี่

เริ่มต้นอย่างรวดเร็ว

สร้างคีย์ ยืนยันโดเมน และส่งอีเมลแบบควบคุมด้วยคำขอที่ลองใหม่ได้อย่างปลอดภัย

ก่อนเริ่มต้น

Create a SendHQ workspace and keep the dashboard open. You can verify a domain and create an API key before paying. Sending requires an active subscription: there is no free allowance, including to your own address. Choose a plan at pricing.

1. สร้าง API key

เปิด API keys ในแดชบอร์ด เลือกชื่อที่สื่อความหมาย เช่น Production และคัดลอกคีย์เมื่อแสดงขึ้นมา เก็บไว้ในตัวจัดการความลับฝั่งเซิร์ฟเวอร์ SendHQ จะไม่แสดงค่าเต็มอีก

.env
SENDHQ_API_KEY=re_your_key_here

2. เพิ่มโดเมนผู้ส่ง

Open Domains, add a domain you control, and publish the returned DKIM, SPF, DMARC, and domain verification records. Copy the records into your DNS host and click Verify. On Cloudflare, add them as DNS only (grey cloud). Add the records, then click Verify.

Do not publish a second SPF policy.If SPF already exists, merge SendHQ's SPF include (include:amazonses.com) into the existing v=spf1 value.

3. รอการยืนยัน

Use the dashboard or POST /domains/:id/verify. DNS can move through pending, checking, and propagating before the sending identity is verified.

4. ส่งข้อความทดสอบแบบควบคุม

curl
curl https://sendhq.cc/api/v1/emails \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: onboarding-user-42" \
  -d '{"from":"Acme <hello@example.com>","to":["owner@example.com"],"subject":"SendHQ is connected","html":"<h1>It works</h1><p>Your first controlled message was accepted.</p>","text":"It works. Your first controlled message was accepted."}'

คำขอที่สำเร็จจะคืน ID อีเมลของ SendHQ ID ข้อความของผู้ให้บริการ และ ID เธรดของบทสนทนา เก็บ ID ของ SendHQ ไว้พร้อมกับอีเวนต์ของแอปพลิเคชันที่ทำให้เกิดอีเมลนั้น

5. จัดการผลลัพธ์

คำขอ API ที่ถูกยอมรับไม่เหมือนกับการส่งถึงผู้รับ ดึง /emails/:id/events หรือใช้แดชบอร์ดเพื่อตรวจสอบอีเวนต์ delivery, bounce, complaint, reject, open และ click