Lokalisiert durch KI

Send email

const response = await fetch('https://api.emailit.com/v2/emails', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from: 'Your Company <hello@yourdomain.com>',
    to: ['recipient1@example.com', 'recipient2@example.com'],
    subject: 'Hello World',
    html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
    tracking: {
      loads: true,
      clicks: true
    }
  })
});

const result = await response.json();

Send with template

const response = await fetch('https://api.emailit.com/v2/emails', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from: 'hello@yourdomain.com',
    to: 'user@example.com',
    template: 'welcome_email',
    variables: {
      name: 'John Doe',
      company: 'Acme Inc',
      activation_url: 'https://example.com/activate?token=abc123'
    }
  })
});

const result = await response.json();

Send with attachment

const response = await fetch('https://api.emailit.com/v2/emails', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from: 'invoices@yourdomain.com',
    to: 'customer@example.com',
    subject: 'Your Invoice #12345',
    html: '<p>Please find your invoice attached.</p>',
    attachments: [
      {
        filename: 'invoice-12345.pdf',
        content: 'JVBERi0xLjQKJcOkw7zDqc...', // base64 encoded
        content_type: 'application/pdf'
      }
    ]
  })
});

const result = await response.json();

Schedule email

const response = await fetch('https://api.emailit.com/v2/emails', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from: 'reminders@yourdomain.com',
    to: 'user@example.com',
    subject: 'Appointment Reminder',
    html: '<p>Your appointment is tomorrow at 2 PM.</p>',
    scheduled_at: 'tomorrow at 9am'
  })
});

const result = await response.json();

Responses

{
  "object": "email",
  "id": "em_abc123xyz789def456ghi012jkl345",
  "ids": {
    "recipient1@example.com": "em_abc123xyz789def456ghi012jkl345",
    "recipient2@example.com": "em_def456abc789ghi012jkl345mno678"
  },
  "token": "abc123xyz789",
  "message_id": "<abc123xyz789@yourdomain.com>",
  "from": "hello@yourdomain.com",
  "to": ["recipient1@example.com", "recipient2@example.com"],
  "cc": ["cc@example.com"],
  "bcc": ["bcc@example.com"],
  "subject": "Hello World",
  "status": "pending",
  "scheduled_at": null,
  "created_at": "2026-01-08T12:00:00.123456Z",
  "tracking": {
    "loads": true,
    "clicks": true
  }
}