{
    "info": {
        "name": "Kartmax Email API",
        "_postman_id": "kmax-email-api-v1",
        "description": "Kartmax Central Email Service \u2014 send mail for one website.\n\n1. Import this collection in Postman (File \u2192 Import).\n2. Open collection variables and set `emailApiKey` to that website's Email API key (Websites \u2192 copy after add/regenerate).\n3. Confirm `baseUrl` is https://email.kartmax.in.\n4. Run **Send email**. A 200 means the mail is queued; SMTP runs in a job. Check Email logs for sent or failed.\n\nAuth: Authorization Bearer = the website Email API key. The key picks the website SMTP (from / reply-to). Do not send SES/SMTP passwords.\n\nDummy local key (williampenn.com): wp_live_dummy_william_penn_key_001xxxxxxxxxxxx",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "https://email.kartmax.in"
        },
        {
            "key": "emailApiKey",
            "value": "wp_live_dummy_william_penn_key_001xxxxxxxxxxxx"
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{emailApiKey}}",
                "type": "string"
            }
        ]
    },
    "item": [
        {
            "name": "Send email",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "X-Application-Name",
                        "value": "Postman",
                        "description": "Optional. Stored on the email log as the calling app name."
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"website\": \"williampenn.com\",\n    \"from\": \"noreply@williampenn.com\",\n    \"to\": [\n        \"customer@example.com\"\n    ],\n    \"subject\": \"Order Confirmation\",\n    \"body\": \"<h1>Thank you for your order</h1><p>Order #12345</p>\",\n    \"body_type\": \"html\",\n    \"reply_to\": \"support@williampenn.com\"\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": "{{baseUrl}}/v1/send",
                "description": "Minimal send. From / reply-to fall back to the website SMTP settings if omitted."
            },
            "response": []
        },
        {
            "name": "Send email with CC and BCC",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "X-Application-Name",
                        "value": "Postman",
                        "description": "Optional. Stored on the email log as the calling app name."
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"website\": \"williampenn.com\",\n    \"from\": \"noreply@williampenn.com\",\n    \"to\": [\n        \"customer@example.com\"\n    ],\n    \"cc\": [\n        \"finance@williampenn.com\"\n    ],\n    \"bcc\": [\n        \"audit@kartmax.in\"\n    ],\n    \"subject\": \"Invoice attached\",\n    \"body\": \"<p>Please find your invoice attached.</p>\",\n    \"body_type\": \"html\"\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": "{{baseUrl}}/v1/send",
                "description": "To, CC and BCC are separate arrays. Each address is logged as its own recipient."
            },
            "response": []
        },
        {
            "name": "Send email with attachments",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    },
                    {
                        "key": "X-Application-Name",
                        "value": "Postman",
                        "description": "Optional. Stored on the email log as the calling app name."
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"website\": \"williampenn.com\",\n    \"from\": \"noreply@williampenn.com\",\n    \"to\": [\n        \"customer@example.com\"\n    ],\n    \"subject\": \"Invoice PDF\",\n    \"body\": \"<p>Invoice is attached. Logo: <img src=\\\"cid:logo\\\" alt=\\\"Logo\\\"></p>\",\n    \"body_type\": \"html\",\n    \"attachments\": [\n        {\n            \"filename\": \"invoice-12345.pdf\",\n            \"content_type\": \"application/pdf\",\n            \"content\": \"JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c+PgplbmRvYmoK\",\n            \"disposition\": \"attachment\"\n        },\n        {\n            \"filename\": \"logo.png\",\n            \"content_type\": \"image/png\",\n            \"content\": \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==\",\n            \"disposition\": \"inline\",\n            \"content_id\": \"logo\"\n        }\n    ]\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": "{{baseUrl}}/v1/send",
                "description": "Attachments are Base64. `disposition: inline` + `content_id` is for cid: images in HTML. Blocked types: exe, bat, cmd, com, js, vbs, scr, pif, msi, ps1, sh, apk."
            },
            "response": []
        },
        {
            "name": "Send email (missing API key)",
            "request": {
                "auth": {
                    "type": "noauth"
                },
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"website\": \"williampenn.com\",\n    \"from\": \"noreply@williampenn.com\",\n    \"to\": [\n        \"customer@example.com\"\n    ],\n    \"subject\": \"Order Confirmation\",\n    \"body\": \"<h1>Thank you for your order</h1><p>Order #12345</p>\",\n    \"body_type\": \"html\",\n    \"reply_to\": \"support@williampenn.com\"\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": "{{baseUrl}}/v1/send",
                "description": "Expect HTTP 401 with success false and message \"Invalid API credentials\"."
            },
            "response": []
        }
    ]
}