GET Retrieve a template
Get specific email template by slug. Please be advised this is restricted to the Platform tier and is not available for apps in test mode.
Endpoint
GET https://api.timekit.io/v2/templates/notifyCustomerOfBooking
Requests from apps whose plan doesn't include email templates (including apps in test mode) return 403.
Response examples
200
json{
"tags": {
"voip": "McFly",
"phone": "(916) 555-4385",
"booking": {
"state": "confirmed",
"graph": "confirm_decline",
"project": {
"slug": "Project Slug",
"name": "Project Name"
},
"resource": {
"voip": "McFly",
"name": "Marty McFly",
"phone": "(916) 555-4385",
"timezone": "America/Los_Angeles",
"email": "marty.mcfly@timekit.io"
}
},
"service": {
"name": "Virtual Appointment",
"image_url": "http://url-to-image",
"description": "Virtual Appointment with store"
},
"location": {
"name": "New York",
"description": "Stored located in New York city",
"meta": {
"t_store_id": 123,
"t_store_capacity": 3,
"t_store_disabled": 0,
"t_store_country": "USA",
"t_store_region": "US-NY",
"t_store_name": "New York",
"t_store_city": "New York",
"t_store_phone": 1234567890,
"t_store_code": "store-001",
"t_store_postal_code": 10023,
"t_store_country_name": "US",
"t_store_region_name": "New York",
"t_store_address": "123 Abc Street",
"t_store_timezone": "America/New_York"
}
},
"customerMeta": {
"latitude": "34.1381168",
"longitude": "-118.3533783"
},
"customer": {
"voip": "McFly",
"name": "Marty McFly",
"phone": "(916) 555-4385",
"timezone": "America/Los_Angeles",
"email": "marty.mcfly@timekit.io"
},
"cancelUrl": "https://some-cancellation-url",
"rescheduleUrl": "https://some-cancellation-url",
"what": "Catch the lightning",
"end": "2022-01-01 02:00:00",
"start": "2022-01-01 01:00:00",
"where": "Courthouse, Hill Valley, CA 95420, USA",
"description": "The lightning strikes at 10:04 PM exactly! I need you to be there Doc!"
},
"projects": [
{
"id": 0,
"name": "Global"
},
{
"id": "a2394d38-5bef-4dc4-a02c-47403017fe86",
"name": "Project A",
"contents": "<!doctype html>\n<html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>Simple Transactional Email</title>\n <style>\n /* -------------------------------------\n GLOBAL RESETS\n ------------------------------------- */\n \n /*All the styling goes here*/\n \n img {\n border: none;\n -ms-interpolation-mode: bicubic;\n max-width: 100%; \n }\n\n body {\n background-color: #f6f6f6;\n font-family: sans-serif;\n -webkit-font-smoothing: antialiased;\n font-size: 14px;\n line-height: 1.4;\n margin: 0;\n padding: 0;\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%; \n }\n\n table {\n border-collapse: separate;\n mso-table-lspace: 0pt;\n mso-table-rspace: 0pt;\n width: 100%; }\n table td {\n font-family: sans-serif;\n font-size: 14px;\n vertical-align: top; \n }\n\n /* -------------------------------------\n BODY & CONTAINER\n ------------------------------------- */\n\n .body {\n background-color: #f6f6f6;\n width: 100%; \n }\n\n /* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */\n .container {\n display: block;\n margin: 0 auto !important;\n /* makes it centered */\n max-width: 580px;\n padding: 10px;\n width: 580px; \n }\n\n /* This should also be a block element, so that it will fill 100% of the .container */\n .content {\n box-sizing: border-box;\n display: block;\n margin: 0 auto;\n max-width: 580px;\n padding: 10px; \n }\n\n /* -------------------------------------\n HEADER, FOOTER, MAIN\n ------------------------------------- */\n .main {\n background: #ffffff;\n border-radius: 3px;\n width: 100%; \n }\n\n .wrapper {\n box-sizing: border-box;\n padding: 20px; \n }\n\n .content-block {\n padding-bottom: 10px;\n padding-top: 10px;\n }\n\n .footer {\n clear: both;\n margin-top: 10px;\n text-align: center;\n width: 100%; \n }\n .footer td,\n .footer p,\n .footer span,\n .footer a {\n color: #999999;\n font-size: 12px;\n text-align: center; \n }\n\n /* -------------------------------------\n TYPOGRAPHY\n ------------------------------------- */\n h1,\n h2,\n h3,\n h4 {\n color: #000000;\n font-family: sans-serif;\n font-weight: 400;\n line-height: 1.4;\n margin: 0;\n margin-bottom: 30px; \n }\n\n h1 {\n font-size: 35px;\n font-weight: 300;\n text-align: center;\n text-transform: capitalize; \n }\n\n p,\n ul,\n ol {\n font-family: sans-serif;\n font-size: 14px;\n font-weight: normal;\n margin: 0;\n margin-bottom: 15px; \n }\n p li,\n ul li,\n ol li {\n list-style-position: inside;\n margin-left: 5px; \n }\n\n a {\n color: #3498db;\n text-decoration: underline; \n }\n\n /* -------------------------------------\n BUTTONS\n ------------------------------------- */\n .btn {\n box-sizing: border-box;\n width: 100%; }\n .btn > tbody > tr > td {\n padding-bottom: 15px; }\n .btn table {\n width: auto; \n }\n .btn table td {\n background-color: #ffffff;\n border-radius: 5px;\n text-align: center; \n }\n .btn a {\n background-color: #ffffff;\n border: solid 1px #3498db;\n border-radius: 5px;\n box-sizing: border-box;\n color: #3498db;\n cursor: pointer;\n display: inline-block;\n font-size: 14px;\n font-weight: bold;\n margin: 0;\n padding: 12px 25px;\n text-decoration: none;\n text-transform: capitalize; \n }\n\n .btn-primary table td {\n background-color: #3498db; \n }\n\n .btn-primary a {\n background-color: #3498db;\n border-color: #3498db;\n color: #ffffff; \n }\n\n /* -------------------------------------\n OTHER STYLES THAT MIGHT BE USEFUL\n ------------------------------------- */\n .last {\n margin-bottom: 0; \n }\n\n .first {\n margin-top: 0; \n }\n\n .align-center {\n text-align: center; \n }\n\n .align-right {\n text-align: right; \n }\n\n .align-left {\n text-align: left; \n }\n\n .clear {\n clear: both; \n }\n\n .mt0 {\n margin-top: 0; \n }\n\n .mb0 {\n margin-bottom: 0; \n }\n\n .preheader {\n color: transparent;\n display: none;\n height: 0;\n max-height: 0;\n max-width: 0;\n opacity: 0;\n overflow: hidden;\n mso-hide: all;\n visibility: hidden;\n width: 0; \n }\n\n .powered-by a {\n text-decoration: none; \n }\n\n hr {\n border: 0;\n border-bottom: 1px solid #f6f6f6;\n margin: 20px 0; \n }\n\n /* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n ------------------------------------- */\n @media only screen and (max-width: 620px) {\n table.body h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important; \n }\n table.body p,\n table.body ul,\n table.body ol,\n table.body td,\n table.body span,\n table.body a {\n font-size: 16px !important; \n }\n table.body .wrapper,\n table.body .article {\n padding: 10px !important; \n }\n table.body .content {\n padding: 0 !important; \n }\n table.body .container {\n padding: 0 !important;\n width: 100% !important; \n }\n table.body .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important; \n }\n table.body .btn table {\n width: 100% !important; \n }\n table.body .btn a {\n width: 100% !important; \n }\n table.body .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important; \n }\n }\n\n /* -------------------------------------\n PRESERVE THESE STYLES IN THE HEAD\n ------------------------------------- */\n @media all {\n .ExternalClass {\n width: 100%; \n }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%; \n }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important; \n }\n #MessageViewBody a {\n color: inherit;\n text-decoration: none;\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n .btn-primary table td:hover {\n background-color: #34495e !important; \n }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important; \n } \n }\n\n </style>\n </head>\n <body>\n <span class=\"preheader\">This is preheader text. Some clients will show this text as a preview.</span>\n <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\">\n <tr>\n <td> </td>\n <td class=\"container\">\n <div class=\"content\">\n\n <!-- START CENTERED WHITE CONTAINER -->\n <table role=\"presentation\" class=\"main\">\n\n <!-- START MAIN CONTENT AREA -->\n <tr>\n <td class=\"wrapper\">\n <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td>\n <p>Hi there,</p>\n <p>Sometimes you just want to send a simple HTML email with a simple design and clear call to action. This is it.</p>\n <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"btn btn-primary\">\n <tbody>\n <tr>\n <td align=\"left\">\n <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tbody>\n <tr>\n <td> <a href=\"http://htmlemail.io\" target=\"_blank\">Call To Action</a> </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n <p>This is a really simple email template. Its sole purpose is to get the recipient to click the button with no distractions.</p>\n <p>Good luck! Hope it works.</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <!-- END MAIN CONTENT AREA -->\n </table>\n <!-- END CENTERED WHITE CONTAINER -->\n\n <!-- START FOOTER -->\n <div class=\"footer\">\n <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td class=\"content-block\">\n <span class=\"apple-link\">Company Inc, 3 Abbey Road, San Francisco CA 94102</span>\n <br> Don't like these emails? <a href=\"../../../images/CScmqnj.gif\">Unsubscribe</a>.\n </td>\n </tr>\n <tr>\n <td class=\"content-block powered-by\">\n Powered by <a href=\"http://htmlemail.io\">HTMLemail</a>.\n </td>\n </tr>\n </table>\n </div>\n <!-- END FOOTER -->\n\n </div>\n </td>\n <td> </td>\n </tr>\n </table>\n </body>\n</html>",
"subject": "Your booking is confirmed",
"override": true
},
{
"id": "000bf6fa-92f0-4b8a-8c43-305370505abb",
"name": "Project B",
"contents": "<!DOCTYPE html>\n<html>\n <head>\n <title>{{ customer.name }}</title>\n </head>\n <body>\n <h1>Project B</h1>\n </body>\n</html>",
"subject": "Your booking with Project B",
"override": false
},
{
"id": "e864dca3-0781-4129-83d2-80673887663a",
"name": "Project C",
"contents": "<!doctype html>\n<html lang=\"en\">\n<head>\n</head>\n<body>\n<div class=\"body\">\n <div class=\"container\">\n <div class=\"header text-center\">\n <a href=\"#homepage\">\n <img src=\"path/to/logo.png\" class=\"logo\" alt=\"SpaceBar Logo\">\n </a>\n </div>\n <div class=\"content\">\n <h1 class=\"text-center\">Nice to meet you %name%!</h1>\n <p class=\"block\">\n Welcome to <strong>the Space Bar</strong>, we can't wait to read what you have to write.\n Get started on your first article and connect with the space bar community.\n </p>\n </div>\n </div>\n</div>\n</body>\n</html>",
"subject": "Nice to meet you",
"override": false
},
{
"id": "555da225-7e10-4d71-beb7-7e9a0a09c7e5",
"name": "Group Booking"
}
],
"name": "Notify customer of booking",
"slug": "notifyCustomerOfBooking",
"app_id": 2
}
The first entry in projects is always the global (app-wide) template, with id 0 and name Global. Each entry that has a saved template also includes its contents, subject and override values. Projects without a saved template only have id and name.