Get email template
GET/v1/email/template/:id
This endpoint retrieves a reusable email template by ID
Request
Path Parameters
id stringrequired
Template ID
Responses
- 200
- 400
- 404
Template retrieved
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
success boolean
template
object
content
object[]
required
Content is required for templates
type stringrequired
Possible values: [text/html, text/plain]
MIME type required
value stringrequired
Email content is required
name stringrequired
subject stringrequired
{
"success": true,
"template": {
"content": [
{
"type": "text/html",
"value": "<!DOCTYPE html><html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Email Template</title>\n <style>\n body {\n font-family: Arial, sans-serif;\n background-color: #f4f4f4;\n margin: 0;\n padding: 0;\n }\n\n .email-container {\n max-width: 600px;\n margin: 20px auto;\n background-color: #ffffff;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n }\n\n .email-header {\n background-color: #007bff;\n color: #ffffff;\n text-align: center;\n padding: 20px;\n }\n\n .email-body {\n padding: 20px;\n color: #333333;\n line-height: 1.6;\n }\n\n .email-body h1 {\n color: #007bff;\n font-size: 24px;\n }\n\n .email-footer {\n background-color: #f4f4f4;\n text-align: center;\n padding: 15px;\n font-size: 14px;\n color: #888888;\n }\n\n .email-footer a {\n color: #007bff;\n text-decoration: none;\n }\n\n .button {\n display: inline-block;\n padding: 10px 20px;\n margin: 20px 0;\n background-color: #007bff;\n color: #ffffff;\n text-decoration: none;\n border-radius: 5px;\n }\n\n .button:hover {\n background-color: #0056b3;\n }\n\n .social-icons {\n margin-top: 20px;\n }\n\n .social-icons img {\n width: 32px;\n margin: 0 10px;\n vertical-align: middle;\n }\n </style>\n</head>\n\n<body>\n <div class=\"email-container\">\n <!-- Email Header -->\n <div class=\"email-header\">\n <h2>Welcome to Our Service!</h2>\n </div>\n\n <!-- Email Body -->\n <div class=\"email-body\">\n <h1>Hello, John Doe!</h1>\n <p>Thank you for signing up for our service. We're excited to have you on board! Click the button below to verify your email address and get started:</p>\n\n <a href=\"https://example.com/verify-email\" class=\"button\">Verify Your Email</a>\n\n <p>If you have any questions, feel free to <a href=\"mailto:support@example.com\">contact our support team</a>. We're here to help you anytime.</p>\n\n <p>Best Regards,<br> The Example Team</p>\n\n <!-- Social Media Links -->\n <div class=\"social-icons\">\n <a href=\"https://facebook.com/example\"><img src=\"https://cdn-icons-png.flaticon.com/512/733/733547.png\" alt=\"Facebook\"></a>\n <a href=\"https://twitter.com/example\"><img src=\"https://cdn-icons-png.flaticon.com/512/733/733579.png\" alt=\"Twitter\"></a>\n <a href=\"https://linkedin.com/company/example\"><img src=\"https://cdn-icons-png.flaticon.com/512/733/733561.png\" alt=\"LinkedIn\"></a>\n </div>\n </div>\n\n <!-- Email Footer -->\n <div class=\"email-footer\">\n <p>You're receiving this email because you signed up for our service.</p>\n <p>If you wish to unsubscribe, click <a href=\"https://example.com/unsubscribe\">here</a>.</p>\n </div>\n </div>\n</body>\n\n</html>"
}
],
"name": "Welcome template",
"subject": "Welcome to our service"
}
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
error string
success boolean
{
"error": "string",
"success": false
}
Template not found
- application/json
- Schema
- Example (from schema)
Schema
error string
success boolean
{
"error": "string",
"success": false
}
Loading...