diff --git a/.perttierrc.json b/.perttierrc.json deleted file mode 100644 index f6ebd00..0000000 --- a/.perttierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "printWidth": 100, - "trailingComma": "es5", - "singleQuote": true, - "tabWidth": 2 -} \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..29fe544 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "printWidth": 100, + "trailingComma": "es5", + "singleQuote": true, + "tabWidth": 2 +} diff --git a/_snippets/browser/upload-attachment.mdx b/_snippets/browser/upload-attachment.mdx index 0a65940..5b40130 100644 --- a/_snippets/browser/upload-attachment.mdx +++ b/_snippets/browser/upload-attachment.mdx @@ -12,13 +12,13 @@ function uploadAttachment(fileBlob, uploadFormUrl, uploadFormData) { form.append(key, value); }); - const file = new File([fileBlob], "file"); - form.append("file", file); + const file = new File([fileBlob], 'file'); + form.append('file', file); console.log(`Uploading attachment to ${uploadFormUrl}`); fetch(uploadFormUrl, { - method: "POST", + method: 'POST', body: form, }) .then((res) => { @@ -28,10 +28,7 @@ function uploadAttachment(fileBlob, uploadFormUrl, uploadFormData) { console.log(`File successfully uploaded! (code=${res.status})`); }) .catch((err) => { - console.log( - `There was an error uploading the file: %s`, - err.message ? err.message : err, - ); + console.log(`There was an error uploading the file: %s`, err.message ? err.message : err); }); } ``` diff --git a/_snippets/graphql/add-labels.mdx b/_snippets/graphql/add-labels.mdx index 9abd80f..f80c013 100644 --- a/_snippets/graphql/add-labels.mdx +++ b/_snippets/graphql/add-labels.mdx @@ -14,10 +14,7 @@ mutation addLabels($input: AddLabelsInput!) { ```json filename="Variables" { "input": { - "labelTypeIds": [ - "lt_01HB8BTNTZ58730MX8H5VMKFD5", - "lt_01HB8BTNKSCF1FK5ETFVRSDC6G" - ], + "labelTypeIds": ["lt_01HB8BTNTZ58730MX8H5VMKFD5", "lt_01HB8BTNKSCF1FK5ETFVRSDC6G"], "threadId": "th_01H8H46YPB2S4MAJM382FG9423" } } diff --git a/_snippets/graphql/remove-customer-from-groups.mdx b/_snippets/graphql/remove-customer-from-groups.mdx index e1e19b3..a14c6d5 100644 --- a/_snippets/graphql/remove-customer-from-groups.mdx +++ b/_snippets/graphql/remove-customer-from-groups.mdx @@ -1,7 +1,5 @@ ```graphql filename="Mutation" -mutation removeCustomerFromCustomerGroup( - $input: RemoveCustomerFromCustomerGroupsInput! -) { +mutation removeCustomerFromCustomerGroup($input: RemoveCustomerFromCustomerGroupsInput!) { removeCustomerFromCustomerGroups(input: $input) { error { message diff --git a/_snippets/node/upload-attachment.mdx b/_snippets/node/upload-attachment.mdx index 9464b7c..084444a 100644 --- a/_snippets/node/upload-attachment.mdx +++ b/_snippets/node/upload-attachment.mdx @@ -1,6 +1,6 @@ ```js -const axios = require("axios"); -const FormData = require("form-data"); +const axios = require('axios'); +const FormData = require('form-data'); /** * Upload an attachment. @@ -15,7 +15,7 @@ function uploadAttachment(fileBuffer, uploadFormUrl, uploadFormData) { form.append(key, value); }); - form.append("file", fileBuffer, { filename: "file" }); + form.append('file', fileBuffer, { filename: 'file' }); console.log(`Uploading attachment to ${uploadFormUrl}`); @@ -23,7 +23,7 @@ function uploadAttachment(fileBuffer, uploadFormUrl, uploadFormData) { .post(uploadFormUrl, form, { headers: { ...form.getHeaders(), - "Content-Length": form.getLengthSync(), + 'Content-Length': form.getLengthSync(), }, }) .then((res) => { @@ -32,7 +32,7 @@ function uploadAttachment(fileBuffer, uploadFormUrl, uploadFormData) { .catch((err) => { console.log( `There was an error uploading the file: %s`, - err.response ? err.response.data : err, + err.response ? err.response.data : err ); }); } diff --git a/_snippets/typescript-sdk/add-customer-to-group-response.mdx b/_snippets/typescript-sdk/add-customer-to-group-response.mdx index 878207a..0a35628 100644 --- a/_snippets/typescript-sdk/add-customer-to-group-response.mdx +++ b/_snippets/typescript-sdk/add-customer-to-group-response.mdx @@ -1,57 +1,57 @@ ```js [ { - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', createdAt: { - __typename: "DateTime", - iso8601: "2023-06-21T14:20:12.014Z", - unixTimestamp: "1687357212014", + __typename: 'DateTime', + iso8601: '2023-06-21T14:20:12.014Z', + unixTimestamp: '1687357212014', }, createdBy: { - __typename: "MachineUserActor", - machineUserId: "mu_01H1P0P0PHA2BJRRS7EC02XKCF", + __typename: 'MachineUserActor', + machineUserId: 'mu_01H1P0P0PHA2BJRRS7EC02XKCF', }, updatedAt: { - __typename: "DateTime", - iso8601: "2023-06-21T14:20:12.014Z", - unixTimestamp: "1687357212014", + __typename: 'DateTime', + iso8601: '2023-06-21T14:20:12.014Z', + unixTimestamp: '1687357212014', }, updatedBy: { - __typename: "MachineUserActor", - machineUserId: "mu_01H1P0P0PHA2BJRRS7EC02XKCF", + __typename: 'MachineUserActor', + machineUserId: 'mu_01H1P0P0PHA2BJRRS7EC02XKCF', }, customerGroup: { - id: "cg_01H1P1RK22WTVMFRY8BX6S6VJX", - name: "free tier", - key: "free-tier", - color: "#E78450", + id: 'cg_01H1P1RK22WTVMFRY8BX6S6VJX', + name: 'free tier', + key: 'free-tier', + color: '#E78450', }, }, { - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', createdAt: { - __typename: "DateTime", - iso8601: "2023-06-21T14:20:12.014Z", - unixTimestamp: "1687357212014", + __typename: 'DateTime', + iso8601: '2023-06-21T14:20:12.014Z', + unixTimestamp: '1687357212014', }, createdBy: { - __typename: "MachineUserActor", - machineUserId: "mu_01H1P0P0PHA2BJRRS7EC02XKCF", + __typename: 'MachineUserActor', + machineUserId: 'mu_01H1P0P0PHA2BJRRS7EC02XKCF', }, updatedAt: { - __typename: "DateTime", - iso8601: "2023-06-21T14:20:12.014Z", - unixTimestamp: "1687357212014", + __typename: 'DateTime', + iso8601: '2023-06-21T14:20:12.014Z', + unixTimestamp: '1687357212014', }, updatedBy: { - __typename: "MachineUserActor", - machineUserId: "mu_01H1P0P0PHA2BJRRS7EC02XKCF", + __typename: 'MachineUserActor', + machineUserId: 'mu_01H1P0P0PHA2BJRRS7EC02XKCF', }, customerGroup: { - id: "cg_01H1P1S2HD9PERNNS591ZT28ZZ", - name: "design partner", - key: "design-partner", - color: "#FBBF24", + id: 'cg_01H1P1S2HD9PERNNS591ZT28ZZ', + name: 'design partner', + key: 'design-partner', + color: '#FBBF24', }, }, ]; diff --git a/_snippets/typescript-sdk/add-customer-to-group.mdx b/_snippets/typescript-sdk/add-customer-to-group.mdx index 59a6889..e53328f 100644 --- a/_snippets/typescript-sdk/add-customer-to-group.mdx +++ b/_snippets/typescript-sdk/add-customer-to-group.mdx @@ -1,16 +1,16 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); const res = await client.addCustomerToCustomerGroups({ - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', customerGroupIdentifiers: [ { - customerGroupKey: "free-tier", + customerGroupKey: 'free-tier', }, { - customerGroupKey: "design-partner", + customerGroupKey: 'design-partner', }, ], }); diff --git a/_snippets/typescript-sdk/add-labels.mdx b/_snippets/typescript-sdk/add-labels.mdx index 0ae8af5..2e0899d 100644 --- a/_snippets/typescript-sdk/add-labels.mdx +++ b/_snippets/typescript-sdk/add-labels.mdx @@ -1,11 +1,11 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); const res = await client.addLabels({ - labelTypeIds: ["lt_01HB8BTNVM7GEBKBEDNC2K8ST7"], - threadId: "th_01HD1G6649R1DK061W27VBT7QB", + labelTypeIds: ['lt_01HB8BTNVM7GEBKBEDNC2K8ST7'], + threadId: 'th_01HD1G6649R1DK061W27VBT7QB', }); if (res.error) { diff --git a/_snippets/typescript-sdk/assign-thread.mdx b/_snippets/typescript-sdk/assign-thread.mdx index 99e1ca7..41552b0 100644 --- a/_snippets/typescript-sdk/assign-thread.mdx +++ b/_snippets/typescript-sdk/assign-thread.mdx @@ -1,13 +1,13 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.assignThread({ - threadId: "th_01H8H46YPB2S4MAJM382FG9423", - userId: "u_01FSVKMHFDHJ3H5XFM20EMCBQN", + threadId: 'th_01H8H46YPB2S4MAJM382FG9423', + userId: 'u_01FSVKMHFDHJ3H5XFM20EMCBQN', // You could instead assign to a machine user by doing: // machineUserId: 'XXX' diff --git a/_snippets/typescript-sdk/create-attachment-url.mdx b/_snippets/typescript-sdk/create-attachment-url.mdx index 3d8d277..f89b496 100644 --- a/_snippets/typescript-sdk/create-attachment-url.mdx +++ b/_snippets/typescript-sdk/create-attachment-url.mdx @@ -1,11 +1,11 @@ ```ts /c_XXXXXXXXXXXXXXXXXXXXXXXXXX/ -import { AttachmentType, PlainClient } from "@team-plain/typescript-sdk"; +import { AttachmentType, PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "XXX" }); +const client = new PlainClient({ apiKey: 'XXX' }); const res = await client.createAttachmentUploadUrl({ - customerId: "c_XXXXXXXXXXXXXXXXXXXXXXXXXX", - fileName: "the-filename.jpeg", + customerId: 'c_XXXXXXXXXXXXXXXXXXXXXXXXXX', + fileName: 'the-filename.jpeg', fileSizeBytes: 32318, attachmentType: AttachmentType.CustomTimelineEntry, }); @@ -13,7 +13,7 @@ const res = await client.createAttachmentUploadUrl({ if (res.error) { console.error(res.error); } else { - console.log("Attachment upload url created"); + console.log('Attachment upload url created'); console.log(res.data); } ``` diff --git a/_snippets/typescript-sdk/create-customer-event.mdx b/_snippets/typescript-sdk/create-customer-event.mdx index ec28252..da5c4cb 100644 --- a/_snippets/typescript-sdk/create-customer-event.mdx +++ b/_snippets/typescript-sdk/create-customer-event.mdx @@ -1,17 +1,17 @@ ```tsx -import { PlainClient, uiComponent } from "@team-plain/typescript-sdk"; +import { PlainClient, uiComponent } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', debug: true, }); const res = await client.createCustomerEvent({ - title: "API key generated", + title: 'API key generated', customerIdentifier: { // You can use the email: - email: "jane@acme.com", + email: 'jane@acme.com', // ...or if you set external id on customers: // externalId: 'YOUR_ID', @@ -22,14 +22,14 @@ const res = await client.createCustomerEvent({ components: [ uiComponent.text({ - text: "New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.", + text: 'New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.', }), uiComponent.spacer({ - size: "M", + size: 'M', }), uiComponent.linkButton({ - label: "View in admin", - url: "https://admin.your-app.com", + label: 'View in admin', + url: 'https://admin.your-app.com', }), ], @@ -37,11 +37,11 @@ const res = await client.createCustomerEvent({ // be created once and fail on the second time. This external id acts // as an idempotency key while also letting you correlate an event to // something your systems. - externalId: "XXX", + externalId: 'XXX', // Optional - if provided then the event will only be shown // in a single thread vs all threads from a customer - threadId: "th_01HB924RWAW8H3Q8KZDFWYBJHZ", + threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', }); if (res.error) { diff --git a/_snippets/typescript-sdk/create-thread.mdx b/_snippets/typescript-sdk/create-thread.mdx index 203a3d8..fb718e7 100644 --- a/_snippets/typescript-sdk/create-thread.mdx +++ b/_snippets/typescript-sdk/create-thread.mdx @@ -1,16 +1,16 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', debug: true, }); const res = await client.createThread({ - title: "Bug Report", + title: 'Bug Report', customerIdentifier: { // You can use the email: - email: "jane@acme.com", + email: 'jane@acme.com', // ...or if you set external id on customers: // externalId: '', @@ -27,7 +27,7 @@ const res = await client.createThread({ ], // Label types are created in settings where you can also copy // their ID. - labelTypeIds: ["lt_01HB924PME9C0YWKW1N4AK3BZA"], + labelTypeIds: ['lt_01HB924PME9C0YWKW1N4AK3BZA'], }); if (res.error) { diff --git a/_snippets/typescript-sdk/delete-customer.mdx b/_snippets/typescript-sdk/delete-customer.mdx index ffef4af..8ead1e5 100644 --- a/_snippets/typescript-sdk/delete-customer.mdx +++ b/_snippets/typescript-sdk/delete-customer.mdx @@ -1,12 +1,12 @@ ```tsx -import { PlainClient } from "../client"; +import { PlainClient } from '../client'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.deleteCustomer({ - customerId: "c_01H1P4TE62AS5KZ4CZFC0578ED", + customerId: 'c_01H1P4TE62AS5KZ4CZFC0578ED', }); if (res.error) { diff --git a/_snippets/typescript-sdk/error-handling.mdx b/_snippets/typescript-sdk/error-handling.mdx index 33c69d3..cb95f34 100644 --- a/_snippets/typescript-sdk/error-handling.mdx +++ b/_snippets/typescript-sdk/error-handling.mdx @@ -1,17 +1,17 @@ ```tsx {21} -import { PlainClient } from "../client"; +import { PlainClient } from '../client'; export async function createCustomer() { - const client = new PlainClient({ apiKey: "XXX" }); + const client = new PlainClient({ apiKey: 'XXX' }); const res = await client.upsertCustomer({ identifier: { - emailAddress: "jane@gmail.com", + emailAddress: 'jane@gmail.com', }, onCreate: { - fullName: "Jane Fargate", + fullName: 'Jane Fargate', email: { - email: "jane@gmail.com", + email: 'jane@gmail.com', isVerified: true, }, }, diff --git a/_snippets/typescript-sdk/first-api-call.mdx b/_snippets/typescript-sdk/first-api-call.mdx index cd102fa..30ff6be 100644 --- a/_snippets/typescript-sdk/first-api-call.mdx +++ b/_snippets/typescript-sdk/first-api-call.mdx @@ -1,8 +1,8 @@ ```ts filename="script.js" {3-4} -const { PlainClient } = require("@team-plain/typescript-sdk"); +const { PlainClient } = require('@team-plain/typescript-sdk'); -const apiKey = "XXX"; -const email = "XXX"; +const apiKey = 'XXX'; +const email = 'XXX'; const client = new PlainClient({ apiKey: apiKey, diff --git a/_snippets/typescript-sdk/get-customer-by-email.mdx b/_snippets/typescript-sdk/get-customer-by-email.mdx index e170ea5..5253d73 100644 --- a/_snippets/typescript-sdk/get-customer-by-email.mdx +++ b/_snippets/typescript-sdk/get-customer-by-email.mdx @@ -1,9 +1,9 @@ ```tsx const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); -const res = await client.getCustomerByEmail({ email: "bob@example.com" }); +const res = await client.getCustomerByEmail({ email: 'bob@example.com' }); if (res.error) { console.error(res.error); diff --git a/_snippets/typescript-sdk/get-customer-by-id.mdx b/_snippets/typescript-sdk/get-customer-by-id.mdx index 415e4f5..08a5ab2 100644 --- a/_snippets/typescript-sdk/get-customer-by-id.mdx +++ b/_snippets/typescript-sdk/get-customer-by-id.mdx @@ -1,10 +1,10 @@ ```tsx const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.getCustomerById({ - customerId: "c_01H14DFQ4PDYBH398J1E99TWSS", + customerId: 'c_01H14DFQ4PDYBH398J1E99TWSS', }); if (res.error) { diff --git a/_snippets/typescript-sdk/get-customers.mdx b/_snippets/typescript-sdk/get-customers.mdx index bcca6f3..b6b8c65 100644 --- a/_snippets/typescript-sdk/get-customers.mdx +++ b/_snippets/typescript-sdk/get-customers.mdx @@ -1,6 +1,6 @@ ```tsx const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.getCustomers({ diff --git a/_snippets/typescript-sdk/mark-thread-as-done.mdx b/_snippets/typescript-sdk/mark-thread-as-done.mdx index 34a85ee..b49caea 100644 --- a/_snippets/typescript-sdk/mark-thread-as-done.mdx +++ b/_snippets/typescript-sdk/mark-thread-as-done.mdx @@ -1,12 +1,12 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.markThreadAsDone({ - threadId: "th_01HB924RWAW8H3Q8KZDFWYBJHZ", + threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', }); if (res.error) { diff --git a/_snippets/typescript-sdk/mark-thread-as-todo.mdx b/_snippets/typescript-sdk/mark-thread-as-todo.mdx index aeda948..be8488f 100644 --- a/_snippets/typescript-sdk/mark-thread-as-todo.mdx +++ b/_snippets/typescript-sdk/mark-thread-as-todo.mdx @@ -1,12 +1,12 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.markThreadAsTodo({ - threadId: "th_01HB924RWAW8H3Q8KZDFWYBJHZ", + threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', }); if (res.error) { diff --git a/_snippets/typescript-sdk/page-info-after.mdx b/_snippets/typescript-sdk/page-info-after.mdx index 882aa12..855dd15 100644 --- a/_snippets/typescript-sdk/page-info-after.mdx +++ b/_snippets/typescript-sdk/page-info-after.mdx @@ -1,8 +1,8 @@ ```tsx -import { PlainClient } from "../client"; +import { PlainClient } from '../client'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const firstPage = client.getCustomers({}); diff --git a/_snippets/typescript-sdk/remove-customer-from-groups.mdx b/_snippets/typescript-sdk/remove-customer-from-groups.mdx index c05dcce..3b1bbb4 100644 --- a/_snippets/typescript-sdk/remove-customer-from-groups.mdx +++ b/_snippets/typescript-sdk/remove-customer-from-groups.mdx @@ -1,18 +1,18 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "plainApiKey_rO6tIKWU2w0gD_ek9HwjsHMiq1MHsgAn7mhVrcC7MGw", + apiKey: 'plainApiKey_rO6tIKWU2w0gD_ek9HwjsHMiq1MHsgAn7mhVrcC7MGw', }); const res = await client.removeCustomerFromCustomerGroups({ - customerId: "c_01H1P4TE62AS5KZ4CZFC0578ED", + customerId: 'c_01H1P4TE62AS5KZ4CZFC0578ED', customerGroupIdentifiers: [ { - customerGroupKey: "free-tier", + customerGroupKey: 'free-tier', }, { - customerGroupKey: "design-partner", + customerGroupKey: 'design-partner', }, ], }); diff --git a/_snippets/typescript-sdk/remove-labels.mdx b/_snippets/typescript-sdk/remove-labels.mdx index f38d6b0..2e9b4bb 100644 --- a/_snippets/typescript-sdk/remove-labels.mdx +++ b/_snippets/typescript-sdk/remove-labels.mdx @@ -1,10 +1,10 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); const res = await client.removeLabels({ - labelIds: ["l_01HD428Y1TREH5KTXP019K6FPK"], + labelIds: ['l_01HD428Y1TREH5KTXP019K6FPK'], }); if (res.error) { diff --git a/_snippets/typescript-sdk/reply-email.mdx b/_snippets/typescript-sdk/reply-email.mdx index bcab140..855f905 100644 --- a/_snippets/typescript-sdk/reply-email.mdx +++ b/_snippets/typescript-sdk/reply-email.mdx @@ -1,13 +1,13 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); client.replyToEmail({ - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", - inReplyToEmailId: "em_01GM2X8K7D3RZ7ZFGHZ2AYG3SA", - textContent: "The plain text version of your reply goes here.", - markdownContent: "The markdown **version** of your _reply_ goes here.", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', + inReplyToEmailId: 'em_01GM2X8K7D3RZ7ZFGHZ2AYG3SA', + textContent: 'The plain text version of your reply goes here.', + markdownContent: 'The markdown **version** of your _reply_ goes here.', }); if (res.error) { diff --git a/_snippets/typescript-sdk/send-email.mdx b/_snippets/typescript-sdk/send-email.mdx index 8a35966..84ee825 100644 --- a/_snippets/typescript-sdk/send-email.mdx +++ b/_snippets/typescript-sdk/send-email.mdx @@ -1,14 +1,14 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); client.sendNewEmail({ - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", - threadId: "th_01HD44FHMCDSSWE38N14FSYV6K", - subject: "Your account has a problem", - textContent: "The plain text version of your email goes here.", - markdownContent: "The markdown **version** of your _email_ goes here.", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', + threadId: 'th_01HD44FHMCDSSWE38N14FSYV6K', + subject: 'Your account has a problem', + textContent: 'The plain text version of your email goes here.', + markdownContent: 'The markdown **version** of your _email_ goes here.', }); if (res.error) { diff --git a/_snippets/typescript-sdk/snooze-thread.mdx b/_snippets/typescript-sdk/snooze-thread.mdx index ce4c1dd..562c41d 100644 --- a/_snippets/typescript-sdk/snooze-thread.mdx +++ b/_snippets/typescript-sdk/snooze-thread.mdx @@ -1,12 +1,12 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.snoozeThread({ - threadId: "th_01HB924RWAW8H3Q8KZDFWYBJHZ", + threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', durationSeconds: 5 * 24 * 60 * 60, // 5 days }); diff --git a/_snippets/typescript-sdk/ui-badge.mdx b/_snippets/typescript-sdk/ui-badge.mdx index e9f5e25..7a99f34 100644 --- a/_snippets/typescript-sdk/ui-badge.mdx +++ b/_snippets/typescript-sdk/ui-badge.mdx @@ -1,5 +1,5 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; -uiComponent.badge({ label: "Subscribed", color: "GREEN" }); +uiComponent.badge({ label: 'Subscribed', color: 'GREEN' }); ``` diff --git a/_snippets/typescript-sdk/ui-container.mdx b/_snippets/typescript-sdk/ui-container.mdx index 6ca6cbe..d11ca4f 100644 --- a/_snippets/typescript-sdk/ui-container.mdx +++ b/_snippets/typescript-sdk/ui-container.mdx @@ -1,7 +1,7 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; uiComponent.container({ - content: [uiComponent.text({ text: "Container content" })], + content: [uiComponent.text({ text: 'Container content' })], }); ``` diff --git a/_snippets/typescript-sdk/ui-copy-button.mdx b/_snippets/typescript-sdk/ui-copy-button.mdx index 36aeeec..60b36cb 100644 --- a/_snippets/typescript-sdk/ui-copy-button.mdx +++ b/_snippets/typescript-sdk/ui-copy-button.mdx @@ -1,8 +1,8 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; uiComponent.copyButton({ - value: "2a8f2dae-3580-402b-aa0a-243efae55e39", - tooltip: "Order ID", + value: '2a8f2dae-3580-402b-aa0a-243efae55e39', + tooltip: 'Order ID', }); ``` diff --git a/_snippets/typescript-sdk/ui-divider.mdx b/_snippets/typescript-sdk/ui-divider.mdx index 5f65873..f79ac81 100644 --- a/_snippets/typescript-sdk/ui-divider.mdx +++ b/_snippets/typescript-sdk/ui-divider.mdx @@ -1,9 +1,9 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; [ - uiComponent.text({ text: "Content before an XS divider" }), - uiComponent.divider({ spacingSize: "XS" }), - uiComponent.text({ text: "Content after divider" }), + uiComponent.text({ text: 'Content before an XS divider' }), + uiComponent.divider({ spacingSize: 'XS' }), + uiComponent.text({ text: 'Content after divider' }), ]; ``` diff --git a/_snippets/typescript-sdk/ui-link-button.mdx b/_snippets/typescript-sdk/ui-link-button.mdx index b427cbf..3a068bf 100644 --- a/_snippets/typescript-sdk/ui-link-button.mdx +++ b/_snippets/typescript-sdk/ui-link-button.mdx @@ -1,8 +1,8 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; uiComponent.linkButton({ - label: "Open in Admin Portal", - url: "https://example.com", + label: 'Open in Admin Portal', + url: 'https://example.com', }); ``` diff --git a/_snippets/typescript-sdk/ui-plain-text.mdx b/_snippets/typescript-sdk/ui-plain-text.mdx index bd191ba..6e87106 100644 --- a/_snippets/typescript-sdk/ui-plain-text.mdx +++ b/_snippets/typescript-sdk/ui-plain-text.mdx @@ -1,21 +1,21 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; [ - uiComponent.plainText({ text: "Small text", size: "S" }), + uiComponent.plainText({ text: 'Small text', size: 'S' }), - uiComponent.plainText({ text: "Medium text", size: "M" }), + uiComponent.plainText({ text: 'Medium text', size: 'M' }), - uiComponent.plainText({ text: "Large text", size: "L" }), + uiComponent.plainText({ text: 'Large text', size: 'L' }), - uiComponent.plainText({ text: "Normal text", color: "NORMAL" }), + uiComponent.plainText({ text: 'Normal text', color: 'NORMAL' }), - uiComponent.plainText({ text: "Muted text", color: "MUTED" }), + uiComponent.plainText({ text: 'Muted text', color: 'MUTED' }), - uiComponent.plainText({ text: "Success text", color: "SUCCESS" }), + uiComponent.plainText({ text: 'Success text', color: 'SUCCESS' }), - uiComponent.plainText({ text: "Warning text", color: "WARNING" }), + uiComponent.plainText({ text: 'Warning text', color: 'WARNING' }), - uiComponent.plainText({ text: "Error text", color: "ERROR" }), + uiComponent.plainText({ text: 'Error text', color: 'ERROR' }), ]; ``` diff --git a/_snippets/typescript-sdk/ui-row.mdx b/_snippets/typescript-sdk/ui-row.mdx index bf2cc29..d8b64f2 100644 --- a/_snippets/typescript-sdk/ui-row.mdx +++ b/_snippets/typescript-sdk/ui-row.mdx @@ -1,8 +1,8 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; uiComponent.row({ - mainContent: [uiComponent.text({ text: "Membership" })], - asideContent: [uiComponent.badge({ label: "Premium plan", color: "BLUE" })], + mainContent: [uiComponent.text({ text: 'Membership' })], + asideContent: [uiComponent.badge({ label: 'Premium plan', color: 'BLUE' })], }); ``` diff --git a/_snippets/typescript-sdk/ui-spacer.mdx b/_snippets/typescript-sdk/ui-spacer.mdx index b125062..59ba5dd 100644 --- a/_snippets/typescript-sdk/ui-spacer.mdx +++ b/_snippets/typescript-sdk/ui-spacer.mdx @@ -1,9 +1,9 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; [ - uiComponent.text({ text: "Content before an XS spacer" }), - uiComponent.spacer({ spacingSize: "XS" }), - uiComponent.text({ text: "Content after spacer" }), + uiComponent.text({ text: 'Content before an XS spacer' }), + uiComponent.spacer({ spacingSize: 'XS' }), + uiComponent.text({ text: 'Content after spacer' }), ]; ``` diff --git a/_snippets/typescript-sdk/ui-text.mdx b/_snippets/typescript-sdk/ui-text.mdx index 9f504ca..94fe86a 100644 --- a/_snippets/typescript-sdk/ui-text.mdx +++ b/_snippets/typescript-sdk/ui-text.mdx @@ -1,25 +1,25 @@ ```tsx -import { uiComponent } from "@team-plain/typescript-sdk"; +import { uiComponent } from '@team-plain/typescript-sdk'; [ uiComponent.text({ - text: "The **quick** brown fox _jumps_ over the [lazy link](https://plain.com)", + text: 'The **quick** brown fox _jumps_ over the [lazy link](https://plain.com)', }), - uiComponent.text({ text: "Small text", size: "S" }), + uiComponent.text({ text: 'Small text', size: 'S' }), - uiComponent.text({ text: "Medium text", size: "M" }), + uiComponent.text({ text: 'Medium text', size: 'M' }), - uiComponent.text({ text: "Large text", size: "L" }), + uiComponent.text({ text: 'Large text', size: 'L' }), - uiComponent.text({ text: "Normal text", color: "NORMAL" }), + uiComponent.text({ text: 'Normal text', color: 'NORMAL' }), - uiComponent.text({ text: "Muted text", color: "MUTED" }), + uiComponent.text({ text: 'Muted text', color: 'MUTED' }), - uiComponent.text({ text: "Success text", color: "SUCCESS" }), + uiComponent.text({ text: 'Success text', color: 'SUCCESS' }), - uiComponent.text({ text: "Warning text", color: "WARNING" }), + uiComponent.text({ text: 'Warning text', color: 'WARNING' }), - uiComponent.text({ text: "Error text", color: "ERROR" }), + uiComponent.text({ text: 'Error text', color: 'ERROR' }), ]; ``` diff --git a/_snippets/typescript-sdk/unassign-thread.mdx b/_snippets/typescript-sdk/unassign-thread.mdx index 25db9a3..28f0152 100644 --- a/_snippets/typescript-sdk/unassign-thread.mdx +++ b/_snippets/typescript-sdk/unassign-thread.mdx @@ -1,12 +1,12 @@ ```tsx -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', }); const res = await client.unassignThread({ - threadId: "th_01H8H46YPB2S4MAJM382FG9423", + threadId: 'th_01H8H46YPB2S4MAJM382FG9423', }); if (res.error) { diff --git a/_snippets/typescript-sdk/upsert-customer.mdx b/_snippets/typescript-sdk/upsert-customer.mdx index 6f56642..5b4d7c9 100644 --- a/_snippets/typescript-sdk/upsert-customer.mdx +++ b/_snippets/typescript-sdk/upsert-customer.mdx @@ -1,32 +1,32 @@ ```ts -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); const res = await client.upsertCustomer({ identifier: { - emailAddress: "donald@example.com", + emailAddress: 'donald@example.com', }, // If the customer is not found and should be created then // these details will be used: onCreate: { - fullName: "Donald Duck", - shortName: "Donald", + fullName: 'Donald Duck', + shortName: 'Donald', email: { - email: "donald@example.com", + email: 'donald@example.com', isVerified: true, }, // This is the id of the customer in your own backend. // Filling this out makes it easy to link customers in Plain // back to customer in your own systems. - externalId: "c_123", + externalId: 'c_123', // This is optional but if you want to put a customer into a group // on creation, this is how you do it. customerGroupIdentifiers: [ { - customerGroupKey: "enterprise", + customerGroupKey: 'enterprise', }, ], }, @@ -35,17 +35,17 @@ const res = await client.upsertCustomer({ // just providing some of the fields below. onUpdate: { fullName: { - value: "Donald Duck", + value: 'Donald Duck', }, shortName: { - value: "Donald", + value: 'Donald', }, email: { - email: "donald@example.com", + email: 'donald@example.com', isVerified: true, }, externalId: { - value: "c_123", + value: 'c_123', }, }, }); diff --git a/pages/attachments.mdx b/pages/attachments.mdx index c15ecfa..3c0198b 100644 --- a/pages/attachments.mdx +++ b/pages/attachments.mdx @@ -1,5 +1,5 @@ --- -title: "File Attachments" +title: 'File Attachments' description: "When using Plain's API to send emails or [create threads](/graphql/threads/create), you can add file attachments." --- @@ -27,13 +27,13 @@ To try this, you will need an [API key](/graphql/authentication/) with the follo ```typescript -import { AttachmentType, PlainClient } from "@team-plain/typescript-sdk"; +import { AttachmentType, PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "XXX" }); +const client = new PlainClient({ apiKey: 'XXX' }); const res = await client.createAttachmentUploadUrl({ - customerId: "c_XXXXXXXXXXXXXXXXXXXXXXXXXX", - fileName: "the-filename.jpeg", + customerId: 'c_XXXXXXXXXXXXXXXXXXXXXXXXXX', + fileName: 'the-filename.jpeg', fileSizeBytes: 32318, attachmentType: AttachmentType.CustomTimelineEntry, }); @@ -41,7 +41,7 @@ const res = await client.createAttachmentUploadUrl({ if (res.error) { console.error(res.error); } else { - console.log("Attachment upload url created"); + console.log('Attachment upload url created'); console.log(res.data); } ``` @@ -229,13 +229,13 @@ function uploadAttachment(fileBlob, uploadFormUrl, uploadFormData) { form.append(key, value); }); - const file = new File([fileBlob], "file"); - form.append("file", file); + const file = new File([fileBlob], 'file'); + form.append('file', file); console.log(`Uploading attachment to ${uploadFormUrl}`); fetch(uploadFormUrl, { - method: "POST", + method: 'POST', body: form, }) .then((res) => { @@ -245,10 +245,7 @@ function uploadAttachment(fileBlob, uploadFormUrl, uploadFormData) { console.log(`File successfully uploaded! (code=${res.status})`); }) .catch((err) => { - console.log( - `There was an error uploading the file: %s`, - err.message ? err.message : err, - ); + console.log(`There was an error uploading the file: %s`, err.message ? err.message : err); }); } ``` @@ -257,8 +254,8 @@ function uploadAttachment(fileBlob, uploadFormUrl, uploadFormData) { ```typescript -const axios = require("axios"); -const FormData = require("form-data"); +const axios = require('axios'); +const FormData = require('form-data'); /** * Upload an attachment. @@ -273,7 +270,7 @@ function uploadAttachment(fileBuffer, uploadFormUrl, uploadFormData) { form.append(key, value); }); - form.append("file", fileBuffer, { filename: "file" }); + form.append('file', fileBuffer, { filename: 'file' }); console.log(`Uploading attachment to ${uploadFormUrl}`); @@ -281,7 +278,7 @@ function uploadAttachment(fileBuffer, uploadFormUrl, uploadFormData) { .post(uploadFormUrl, form, { headers: { ...form.getHeaders(), - "Content-Length": form.getLengthSync(), + 'Content-Length': form.getLengthSync(), }, }) .then((res) => { @@ -290,7 +287,7 @@ function uploadAttachment(fileBuffer, uploadFormUrl, uploadFormData) { .catch((err) => { console.log( `There was an error uploading the file: %s`, - err.response ? err.response.data : err, + err.response ? err.response.data : err ); }); } diff --git a/pages/contact-forms-setup.mdx b/pages/contact-forms-setup.mdx index 25e1020..0c9932e 100644 --- a/pages/contact-forms-setup.mdx +++ b/pages/contact-forms-setup.mdx @@ -1,6 +1,6 @@ --- -title: "Contact forms" -description: "Contact forms are the best way to offer support at scale. With contact forms, you can pre-triage every support request so that when you know exactly what to prioritize in Plain." +title: 'Contact forms' +description: 'Contact forms are the best way to offer support at scale. With contact forms, you can pre-triage every support request so that when you know exactly what to prioritize in Plain.' --- Plain **does not** provide any UI components or a drop-in script tag. Instead, you use your own UI components and then use Plain's API. diff --git a/pages/customer-cards-setup.mdx b/pages/customer-cards-setup.mdx index 8f40fea..127dd7e 100644 --- a/pages/customer-cards-setup.mdx +++ b/pages/customer-cards-setup.mdx @@ -1,6 +1,6 @@ --- -title: "Customer Cards" -description: "Customer Cards are a powerful feature in Plain that let you show information from your own systems while looking at a customer in Plain. This makes sure you always have important context when helping customers." +title: 'Customer Cards' +description: 'Customer Cards are a powerful feature in Plain that let you show information from your own systems while looking at a customer in Plain. This makes sure you always have important context when helping customers.' --- diff --git a/pages/customer-cards.mdx b/pages/customer-cards.mdx index d1e15cf..b445370 100644 --- a/pages/customer-cards.mdx +++ b/pages/customer-cards.mdx @@ -1,7 +1,7 @@ --- -title: "Customer Cards" -sidebarTitle: "Overview" -description: "Customer Cards are a powerful feature in Plain that let you show information from your own systems while looking at a customer in Plain. This makes sure you always have important context when helping customers." +title: 'Customer Cards' +sidebarTitle: 'Overview' +description: 'Customer Cards are a powerful feature in Plain that let you show information from your own systems while looking at a customer in Plain. This makes sure you always have important context when helping customers.' --- ## How it works diff --git a/pages/customer-cards/documentation.mdx b/pages/customer-cards/documentation.mdx index 5fe459f..4a04cfe 100644 --- a/pages/customer-cards/documentation.mdx +++ b/pages/customer-cards/documentation.mdx @@ -1,6 +1,6 @@ --- -title: "Customer Cards Documentation" -description: "This page is intended for a technical audience that will be implementing a Customer Card API." +title: 'Customer Cards Documentation' +description: 'This page is intended for a technical audience that will be implementing a Customer Card API.' --- Check out the [Customer Cards](/pages/customer-cards) page for an overview. diff --git a/pages/customer-cards/examples.mdx b/pages/customer-cards/examples.mdx index dc7044c..52dbcab 100644 --- a/pages/customer-cards/examples.mdx +++ b/pages/customer-cards/examples.mdx @@ -1,5 +1,5 @@ --- -title: "Examples" -icon: "link" -url: "https://github.com/team-plain/example-customer-cards" +title: 'Examples' +icon: 'link' +url: 'https://github.com/team-plain/example-customer-cards' --- diff --git a/pages/customer-cards/playground.mdx b/pages/customer-cards/playground.mdx index 8d38934..41fdae6 100644 --- a/pages/customer-cards/playground.mdx +++ b/pages/customer-cards/playground.mdx @@ -1,5 +1,5 @@ --- -title: "Playground" -icon: "link" -url: "https://app.plain.com/developer/customer-cards-playground/" +title: 'Playground' +icon: 'link' +url: 'https://app.plain.com/developer/customer-cards-playground/' --- diff --git a/pages/email-setup.mdx b/pages/email-setup.mdx index 607348b..54f3036 100644 --- a/pages/email-setup.mdx +++ b/pages/email-setup.mdx @@ -1,5 +1,5 @@ --- -title: "Setting up email" +title: 'Setting up email' --- Setting up email requires you to complete two steps: diff --git a/pages/email-setup/receiving-emails.mdx b/pages/email-setup/receiving-emails.mdx index 650b353..abdbc4c 100644 --- a/pages/email-setup/receiving-emails.mdx +++ b/pages/email-setup/receiving-emails.mdx @@ -1,6 +1,4 @@ -import { Callout, Steps } from "nextra-theme-docs"; - -import { ImageContainer } from "../../components/imageContainer"; +import { Callout, Steps } from 'nextra-theme-docs'; # Receiving emails in Plain @@ -49,5 +47,4 @@ If your email provider is not Google, you can still set up email forwarding in d - And That's it! 💅 diff --git a/pages/email-setup/sending-emails.mdx b/pages/email-setup/sending-emails.mdx index 4a3b0cd..152b352 100644 --- a/pages/email-setup/sending-emails.mdx +++ b/pages/email-setup/sending-emails.mdx @@ -1,6 +1,6 @@ --- -title: "Sending emails from Plain" -description: "To be able to send emails from Plain using your support email address, you will need to add a couple of DNS records to your domain." +title: 'Sending emails from Plain' +description: 'To be able to send emails from Plain using your support email address, you will need to add a couple of DNS records to your domain.' --- While setting up your email, you will see DNS settings that need to be diff --git a/pages/events-setup.mdx b/pages/events-setup.mdx index cee8373..49f0818 100644 --- a/pages/events-setup.mdx +++ b/pages/events-setup.mdx @@ -1,11 +1,9 @@ --- -title: "Events" +title: 'Events' description: "Events are a powerful API feature of Plain which let you log key events to have more context while you are helping a customer. This includes tracking a customer's usage of your product, latest invoice, error logs, etc." --- - - ![Screenshot of the Events](/public/images/events/events-introduction.png) - +![Screenshot of the Events](/public/images/events/events-introduction.png) When you create an event in Plain, you can specify the content of the event using a simple GraphQL request and our [UI Components](/ui-components). diff --git a/pages/graphql.mdx b/pages/graphql.mdx index 6f2f29b..06797ed 100644 --- a/pages/graphql.mdx +++ b/pages/graphql.mdx @@ -1,6 +1,6 @@ --- -title: "GraphQL API" -sidebarTitle: "Overview" +title: 'GraphQL API' +sidebarTitle: 'Overview' description: "Plain's GraphQL API can be used to manage any aspect of Plain. It's the API we use to build the Plain app which means there are no restrictions on what you can do via the API vs the Plain app." --- @@ -57,12 +57,8 @@ You will need an API key with the `customer:read` permission. See [authenticatio This assumes you've installed our Typescript SDK. - - ```shell npm install @team-plain/typescript-sdk ``` - - - Make sure to replace the api key and email in the code - + ```shell npm install @team-plain/typescript-sdk ``` + Make sure to replace the api key and email in the code ```shell node script.js ``` diff --git a/pages/graphql/api-explorer.mdx b/pages/graphql/api-explorer.mdx index 278ea5f..75e5a1e 100644 --- a/pages/graphql/api-explorer.mdx +++ b/pages/graphql/api-explorer.mdx @@ -1,5 +1,5 @@ --- -title: "API Explorer" -icon: "link" -url: "https://app.plain.com/developer/api-explorer/?workspaceId=w_01H3FZJ8MG74GFXA5WA3MPB446" +title: 'API Explorer' +icon: 'link' +url: 'https://app.plain.com/developer/api-explorer/?workspaceId=w_01H3FZJ8MG74GFXA5WA3MPB446' --- diff --git a/pages/graphql/authentication.mdx b/pages/graphql/authentication.mdx index 919f584..d391396 100644 --- a/pages/graphql/authentication.mdx +++ b/pages/graphql/authentication.mdx @@ -1,5 +1,5 @@ --- -title: "Authentication" +title: 'Authentication' description: "To make API calls you need an API key. To create an API key you'll first need to create a Machine User." --- diff --git a/pages/graphql/customers.mdx b/pages/graphql/customers.mdx index abd9826..075c110 100644 --- a/pages/graphql/customers.mdx +++ b/pages/graphql/customers.mdx @@ -1,7 +1,7 @@ --- -title: "Customers" -sidebarTitle: "Overview" -description: "Customers that reach out to you will automatically be created in Plain without requiring any API integration." +title: 'Customers' +sidebarTitle: 'Overview' +description: 'Customers that reach out to you will automatically be created in Plain without requiring any API integration.' --- However, using our API to manage customers proactively can be helpful when you are optimizing your support workflow. diff --git a/pages/graphql/customers/customer-groups.mdx b/pages/graphql/customers/customer-groups.mdx index 6544476..9a6729e 100644 --- a/pages/graphql/customers/customer-groups.mdx +++ b/pages/graphql/customers/customer-groups.mdx @@ -1,6 +1,6 @@ --- -title: "Customer groups" -description: "Customer groups can be used to group and segment your customers, e.g. pricing tier: free, paying, enterprise etc." +title: 'Customer groups' +description: 'Customer groups can be used to group and segment your customers, e.g. pricing tier: free, paying, enterprise etc.' --- Customers can belong to one or many groups. You can filter your customers by group, allowing you to quickly focus on a subset of your customers. @@ -25,18 +25,18 @@ This operation requires the following permissions: ```typescript -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); const res = await client.addCustomerToCustomerGroups({ - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', customerGroupIdentifiers: [ { - customerGroupKey: "free-tier", + customerGroupKey: 'free-tier', }, { - customerGroupKey: "design-partner", + customerGroupKey: 'design-partner', }, ], }); @@ -208,20 +208,20 @@ A customer can be removed from a customer group by using the `removeCustomerFrom ```typescript -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "plainApiKey_rO6tIKWU2w0gD_ek9HwjsHMiq1MHsgAn7mhVrcC7MGw", + apiKey: 'plainApiKey_rO6tIKWU2w0gD_ek9HwjsHMiq1MHsgAn7mhVrcC7MGw', }); const res = await client.removeCustomerFromCustomerGroups({ - customerId: "c_01H1P4TE62AS5KZ4CZFC0578ED", + customerId: 'c_01H1P4TE62AS5KZ4CZFC0578ED', customerGroupIdentifiers: [ { - customerGroupKey: "free-tier", + customerGroupKey: 'free-tier', }, { - customerGroupKey: "design-partner", + customerGroupKey: 'design-partner', }, ], }); @@ -239,9 +239,7 @@ if (res.error) { ```graphql Mutation -mutation removeCustomerFromCustomerGroup( - $input: RemoveCustomerFromCustomerGroupsInput! -) { +mutation removeCustomerFromCustomerGroup($input: RemoveCustomerFromCustomerGroupsInput!) { removeCustomerFromCustomerGroups(input: $input) { error { message diff --git a/pages/graphql/customers/delete.mdx b/pages/graphql/customers/delete.mdx index 24f715a..482ef1d 100644 --- a/pages/graphql/customers/delete.mdx +++ b/pages/graphql/customers/delete.mdx @@ -1,6 +1,6 @@ -import DeleteCustomerTypescriptSDK from "../../../snippets/typescript-sdk/delete-customer.mdx"; -import DeleteCustomerGraphQL from "../../../snippets/graphql/delete-customer.mdx"; -import { Tab, Tabs } from "nextra-theme-docs"; +import DeleteCustomerTypescriptSDK from '../../../snippets/typescript-sdk/delete-customer.mdx'; +import DeleteCustomerGraphQL from '../../../snippets/graphql/delete-customer.mdx'; +import { Tab, Tabs } from 'nextra-theme-docs'; # Delete customers diff --git a/pages/graphql/customers/get.mdx b/pages/graphql/customers/get.mdx index 01cf9b6..380f7c6 100644 --- a/pages/graphql/customers/get.mdx +++ b/pages/graphql/customers/get.mdx @@ -1,5 +1,5 @@ --- -title: "Fetch customers" +title: 'Fetch customers' --- We provide a number of methods for fetching customers: diff --git a/pages/graphql/customers/upsert.mdx b/pages/graphql/customers/upsert.mdx index 02662c2..f807911 100644 --- a/pages/graphql/customers/upsert.mdx +++ b/pages/graphql/customers/upsert.mdx @@ -1,6 +1,6 @@ --- -title: "Upserting customers" -description: "Creating and updating customers is handled via a single API called `upsertCustomer`. You will find this name in both our API and our SDKs." +title: 'Upserting customers' +description: 'Creating and updating customers is handled via a single API called `upsertCustomer`. You will find this name in both our API and our SDKs.' --- When you upsert a customer, you define: @@ -32,34 +32,34 @@ This will: ```typescript -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); const res = await client.upsertCustomer({ identifier: { - emailAddress: "donald@example.com", + emailAddress: 'donald@example.com', }, // If the customer is not found and should be created then // these details will be used: onCreate: { - fullName: "Donald Duck", - shortName: "Donald", + fullName: 'Donald Duck', + shortName: 'Donald', email: { - email: "donald@example.com", + email: 'donald@example.com', isVerified: true, }, // This is the id of the customer in your own backend. // Filling this out makes it easy to link customers in Plain // back to customer in your own systems. - externalId: "c_123", + externalId: 'c_123', // This is optional but if you want to put a customer into a group // on creation, this is how you do it. customerGroupIdentifiers: [ { - customerGroupKey: "enterprise", + customerGroupKey: 'enterprise', }, ], }, @@ -68,17 +68,17 @@ const res = await client.upsertCustomer({ // just providing some of the fields below. onUpdate: { fullName: { - value: "Donald Duck", + value: 'Donald Duck', }, shortName: { - value: "Donald", + value: 'Donald', }, email: { - email: "donald@example.com", + email: 'donald@example.com', isVerified: true, }, externalId: { - value: "c_123", + value: 'c_123', }, }, }); diff --git a/pages/graphql/error-codes.mdx b/pages/graphql/error-codes.mdx index ca3d28b..735e712 100644 --- a/pages/graphql/error-codes.mdx +++ b/pages/graphql/error-codes.mdx @@ -1,6 +1,6 @@ --- -title: "Error codes" -description: "If you receive an error code as part of an API call, this is where you can look up what it means:" +title: 'Error codes' +description: 'If you receive an error code as part of an API call, this is where you can look up what it means:' --- #### `input_validation` diff --git a/pages/graphql/error-handling.mdx b/pages/graphql/error-handling.mdx index 29e28a2..bbf5bb8 100644 --- a/pages/graphql/error-handling.mdx +++ b/pages/graphql/error-handling.mdx @@ -1,6 +1,6 @@ --- -title: "Error handling" -description: "GraphQL queries and mutations require different error handling." +title: 'Error handling' +description: 'GraphQL queries and mutations require different error handling.' --- This is because we expect: @@ -67,19 +67,19 @@ You can see the [full error types in the code of the Typescript SDK](https://git This is how you can access the error when using the SDK: ```typescript -import { PlainClient } from "../client"; +import { PlainClient } from '../client'; export async function createCustomer() { - const client = new PlainClient({ apiKey: "XXX" }); + const client = new PlainClient({ apiKey: 'XXX' }); const res = await client.upsertCustomer({ identifier: { - emailAddress: "jane@gmail.com", + emailAddress: 'jane@gmail.com', }, onCreate: { - fullName: "Jane Fargate", + fullName: 'Jane Fargate', email: { - email: "jane@gmail.com", + email: 'jane@gmail.com', isVerified: true, }, }, diff --git a/pages/graphql/events.mdx b/pages/graphql/events.mdx index d437268..16bb9cc 100644 --- a/pages/graphql/events.mdx +++ b/pages/graphql/events.mdx @@ -1,7 +1,7 @@ --- -title: "Events" -sidebarTitle: "Overview" -description: "When helping a customer it can be useful to have context about their recent activity in your product. For example, if someone is getting in touch about a 401 error, it could be important to know that they recently deleted an API key in their settings." +title: 'Events' +sidebarTitle: 'Overview' +description: 'When helping a customer it can be useful to have context about their recent activity in your product. For example, if someone is getting in touch about a 401 error, it could be important to know that they recently deleted an API key in their settings.' --- Events are created via the Plain API and you have full control of what they look like using Plain's UI components. diff --git a/pages/graphql/events/create-customer-event.mdx b/pages/graphql/events/create-customer-event.mdx index b0ff89f..85e37a8 100644 --- a/pages/graphql/events/create-customer-event.mdx +++ b/pages/graphql/events/create-customer-event.mdx @@ -1,11 +1,10 @@ --- -title: "Create a customer event" +title: 'Create a customer event' --- - This API is being actively developed and is not yet ready for production - usage. If you are interested in using events please get in touch with us at - [help@plain.com](mailto:help@plain.com) + This API is being actively developed and is not yet ready for production usage. If you are + interested in using events please get in touch with us at [help@plain.com](mailto:help@plain.com) To create an event you need a customer ID. diff --git a/pages/graphql/labels.mdx b/pages/graphql/labels.mdx index 5f42143..db80e6a 100644 --- a/pages/graphql/labels.mdx +++ b/pages/graphql/labels.mdx @@ -1,7 +1,7 @@ --- -title: "Labels" -sidebarTitle: "Overview" -description: "Labels are a light-weight but powerful way to categorise threads, consisting of label text coupled with an icon. Each thread can have multiple labels." +title: 'Labels' +sidebarTitle: 'Overview' +description: 'Labels are a light-weight but powerful way to categorise threads, consisting of label text coupled with an icon. Each thread can have multiple labels.' --- They can be added manually or programatically. For example when a contact form is submitted, you could automatically add a label to the corresponding thread with the issue category they selected, so that you know upfront why they are getting in touch. diff --git a/pages/graphql/labels/add.mdx b/pages/graphql/labels/add.mdx index f6cf7e4..d1e33bf 100644 --- a/pages/graphql/labels/add.mdx +++ b/pages/graphql/labels/add.mdx @@ -1,6 +1,6 @@ --- -title: "Add labels" -description: "You can add multiple labels to a thread with a call to `addLabels`. Label type IDs passed to this endpoint should not be archived, we return a validation error with code `cannot_add_label_using_archived_label_type` for any which are submitted." +title: 'Add labels' +description: 'You can add multiple labels to a thread with a call to `addLabels`. Label type IDs passed to this endpoint should not be archived, we return a validation error with code `cannot_add_label_using_archived_label_type` for any which are submitted.' --- If a label type you provide is already added to the thread we will return a validation error with code `label_with_given_type_already_added_to_thread`. @@ -113,10 +113,7 @@ mutation addLabels($input: AddLabelsInput!) { ```json Variables { "input": { - "labelTypeIds": [ - "lt_01HB8BTNTZ58730MX8H5VMKFD5", - "lt_01HB8BTNKSCF1FK5ETFVRSDC6G" - ], + "labelTypeIds": ["lt_01HB8BTNTZ58730MX8H5VMKFD5", "lt_01HB8BTNKSCF1FK5ETFVRSDC6G"], "threadId": "th_01H8H46YPB2S4MAJM382FG9423" } } diff --git a/pages/graphql/labels/remove.mdx b/pages/graphql/labels/remove.mdx index 555d802..d8c8c25 100644 --- a/pages/graphql/labels/remove.mdx +++ b/pages/graphql/labels/remove.mdx @@ -1,6 +1,6 @@ --- -title: "Remove labels" -description: "You can remove labels from a thread with a call to `removeLabels`. Label IDs for this call can be retrieved by fetching a thread with the API." +title: 'Remove labels' +description: 'You can remove labels from a thread with a call to `removeLabels`. Label IDs for this call can be retrieved by fetching a thread with the API.' --- This operation requires the following permissions: diff --git a/pages/graphql/messaging.mdx b/pages/graphql/messaging.mdx index 513070e..fd688b5 100644 --- a/pages/graphql/messaging.mdx +++ b/pages/graphql/messaging.mdx @@ -1,7 +1,7 @@ --- -title: "Messaging" -sidebarTitle: "Overview" -description: "We provide various methods to message your customers with the Plain API. You can use this to reach out proactively, build an autoresponder or even to handle things like waiting list access!" +title: 'Messaging' +sidebarTitle: 'Overview' +description: 'We provide various methods to message your customers with the Plain API. You can use this to reach out proactively, build an autoresponder or even to handle things like waiting list access!' --- diff --git a/pages/graphql/messaging/reply-email.mdx b/pages/graphql/messaging/reply-email.mdx index cf8f9f5..6d27c0c 100644 --- a/pages/graphql/messaging/reply-email.mdx +++ b/pages/graphql/messaging/reply-email.mdx @@ -1,7 +1,7 @@ -import { Tab, Tabs } from "nextra-theme-docs"; +import { Tab, Tabs } from 'nextra-theme-docs'; -import ReplyEmailTypescriptSDK from "../../../snippets/typescript-sdk/reply-email.mdx"; -import ReplyEmailGraphQL from "../../../snippets/graphql/reply-email.mdx"; +import ReplyEmailTypescriptSDK from '../../../snippets/typescript-sdk/reply-email.mdx'; +import ReplyEmailGraphQL from '../../../snippets/graphql/reply-email.mdx'; # Reply to emails @@ -16,15 +16,15 @@ You can reply to an inbound email with the `replyToEmail` API. - `attachment:read` ```typescript -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; -const client = new PlainClient({ apiKey: "plainApiKey_xxx" }); +const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); client.replyToEmail({ - customerId: "c_01GTC6ZHCMAGR06FMPN9VY5J95", - inReplyToEmailId: "em_01GM2X8K7D3RZ7ZFGHZ2AYG3SA", - textContent: "The plain text version of your reply goes here.", - markdownContent: "The markdown **version** of your _reply_ goes here.", + customerId: 'c_01GTC6ZHCMAGR06FMPN9VY5J95', + inReplyToEmailId: 'em_01GM2X8K7D3RZ7ZFGHZ2AYG3SA', + textContent: 'The plain text version of your reply goes here.', + markdownContent: 'The markdown **version** of your _reply_ goes here.', }); if (res.error) { diff --git a/pages/graphql/messaging/send-email.mdx b/pages/graphql/messaging/send-email.mdx index 2f443b0..047aeb5 100644 --- a/pages/graphql/messaging/send-email.mdx +++ b/pages/graphql/messaging/send-email.mdx @@ -1,6 +1,6 @@ --- -title: "Send emails" -description: "You can send new outbound emails to customers with the `sendNewEmail` API. This is useful for proactively reaching out about issues." +title: 'Send emails' +description: 'You can send new outbound emails to customers with the `sendNewEmail` API. This is useful for proactively reaching out about issues.' --- diff --git a/pages/graphql/pagination.mdx b/pages/graphql/pagination.mdx index f5ce491..c6802e5 100644 --- a/pages/graphql/pagination.mdx +++ b/pages/graphql/pagination.mdx @@ -1,6 +1,6 @@ --- -title: "Pagination" -description: "When fetching collections from our API you can use pagination to control how much data is returned. We will return 25 records per request by default and the maximum page size is 100 records." +title: 'Pagination' +description: 'When fetching collections from our API you can use pagination to control how much data is returned. We will return 25 records per request by default and the maximum page size is 100 records.' --- We support two forms of page control arguments: diff --git a/pages/graphql/schema.mdx b/pages/graphql/schema.mdx index 80a1e35..9c80ec0 100644 --- a/pages/graphql/schema.mdx +++ b/pages/graphql/schema.mdx @@ -1,5 +1,5 @@ --- -title: "Schema" +title: 'Schema' description: We build the Plain app using this API so there are no limits in terms of what you can do programmatically vs. using the Plain app." --- diff --git a/pages/graphql/threads.mdx b/pages/graphql/threads.mdx index 3b45f7f..055e8a1 100644 --- a/pages/graphql/threads.mdx +++ b/pages/graphql/threads.mdx @@ -1,5 +1,5 @@ --- -title: "Threads" +title: 'Threads' sidebarTitle: Overview description: "Threads are the core of Plain's data model and equivalent to tickets or conversations in other support platforms. When you use Plain to help a customer you assign yourself to a thread and then mark the thread as done once you're done helping." --- @@ -13,10 +13,9 @@ Threads belong to one customer but can contain multiple email threads and custom An example thread looks like this: - The below is only showing a subset fields a thread has. Since our API is a - GraphQL API you decide which fields you need when you make API requests. Use - our [API explorer](https://app.plain.com/developer/api-explorer) to discover - the full schema of threads. + The below is only showing a subset fields a thread has. Since our API is a GraphQL API you decide + which fields you need when you make API requests. Use our [API + explorer](https://app.plain.com/developer/api-explorer) to discover the full schema of threads. diff --git a/pages/graphql/threads/assignment.mdx b/pages/graphql/threads/assignment.mdx index dd72906..3cf013a 100644 --- a/pages/graphql/threads/assignment.mdx +++ b/pages/graphql/threads/assignment.mdx @@ -1,9 +1,9 @@ -import { Tabs, Tab } from "nextra-theme-docs"; -import AssignThreadTypescriptSDK from "../../../snippets/typescript-sdk/assign-thread.mdx"; -import AssignThreadResponseTypescriptSDK from "../../../snippets/typescript-sdk/assign-thread-response.mdx"; -import AssignThreadGraphQL from "../../../snippets/graphql/assign-thread.mdx"; -import UnassignThreadTypescriptSDK from "../../../snippets/typescript-sdk/unassign-thread.mdx"; -import UnassignThreadGraphQL from "../../../snippets/graphql/unassign-thread.mdx"; +import { Tabs, Tab } from 'nextra-theme-docs'; +import AssignThreadTypescriptSDK from '../../../snippets/typescript-sdk/assign-thread.mdx'; +import AssignThreadResponseTypescriptSDK from '../../../snippets/typescript-sdk/assign-thread-response.mdx'; +import AssignThreadGraphQL from '../../../snippets/graphql/assign-thread.mdx'; +import UnassignThreadTypescriptSDK from '../../../snippets/typescript-sdk/unassign-thread.mdx'; +import UnassignThreadGraphQL from '../../../snippets/graphql/unassign-thread.mdx'; # Assign threads diff --git a/pages/graphql/threads/create.mdx b/pages/graphql/threads/create.mdx index 67d2e72..fee0337 100644 --- a/pages/graphql/threads/create.mdx +++ b/pages/graphql/threads/create.mdx @@ -1,5 +1,5 @@ --- -title: "Create Threads" +title: 'Create Threads' description: Creating a thread is useful in scenarios where you want to programatically start a support interaction." --- @@ -25,18 +25,18 @@ To create a thread you need a `customerId`. You can get a customer id by [creati - `user:read` ```typescript -import { PlainClient } from "@team-plain/typescript-sdk"; +import { PlainClient } from '@team-plain/typescript-sdk'; const client = new PlainClient({ - apiKey: "XXX", + apiKey: 'XXX', debug: true, }); const res = await client.createThread({ - title: "Bug Report", + title: 'Bug Report', customerIdentifier: { // You can use the email: - email: "jane@acme.com", + email: 'jane@acme.com', // ...or if you set external id on customers: // externalId: '', @@ -53,7 +53,7 @@ const res = await client.createThread({ ], // Label types are created in settings where you can also copy // their ID. - labelTypeIds: ["lt_01HB924PME9C0YWKW1N4AK3BZA"], + labelTypeIds: ['lt_01HB924PME9C0YWKW1N4AK3BZA'], }); if (res.error) { diff --git a/pages/graphql/threads/status-changes.mdx b/pages/graphql/threads/status-changes.mdx index 500ff61..cc31643 100644 --- a/pages/graphql/threads/status-changes.mdx +++ b/pages/graphql/threads/status-changes.mdx @@ -1,5 +1,5 @@ --- -title: "Changing thread status" +title: 'Changing thread status' --- Threads can be in one of 3 statuses: diff --git a/pages/graphql/typescript-sdk.mdx b/pages/graphql/typescript-sdk.mdx index fefbc36..1692db0 100644 --- a/pages/graphql/typescript-sdk.mdx +++ b/pages/graphql/typescript-sdk.mdx @@ -1,5 +1,5 @@ --- -title: "Typescript SDK" -icon: "link" -url: "https://github.com/team-plain/typescript-sdk/" +title: 'Typescript SDK' +icon: 'link' +url: 'https://github.com/team-plain/typescript-sdk/' --- diff --git a/pages/introduction.mdx b/pages/introduction.mdx index 94164a3..09953c4 100644 --- a/pages/introduction.mdx +++ b/pages/introduction.mdx @@ -1,6 +1,6 @@ --- -title: "Getting started with Plain" -description: "Plain is the customer support tool for technical B2B products." +title: 'Getting started with Plain' +description: 'Plain is the customer support tool for technical B2B products.' --- We want to bring engineering and support teams together by creating a modern opinionated platform that's fantastic to build with and use. diff --git a/pages/labels-setup.mdx b/pages/labels-setup.mdx index 4beaf11..4235f26 100644 --- a/pages/labels-setup.mdx +++ b/pages/labels-setup.mdx @@ -1,6 +1,6 @@ --- -title: "Labels" -description: "Labels are a light weight and powerful way to categorize threads in Plain." +title: 'Labels' +description: 'Labels are a light weight and powerful way to categorize threads in Plain.' --- ![Example labels](/public/images/labels/labels-introduction.png) diff --git a/pages/linear-integration-setup.mdx b/pages/linear-integration-setup.mdx index 0258e72..a246712 100644 --- a/pages/linear-integration-setup.mdx +++ b/pages/linear-integration-setup.mdx @@ -1,6 +1,6 @@ --- -title: "Linear integration" -description: "To easily keep track of feature requests and bugs reported in Plain, you can connect your Linear workspace with Plain." +title: 'Linear integration' +description: 'To easily keep track of feature requests and bugs reported in Plain, you can connect your Linear workspace with Plain.' --- This lets you easily link a Linear issue to a thread. diff --git a/pages/migrate-to-threads.mdx b/pages/migrate-to-threads.mdx index d69e2c8..f81cdad 100644 --- a/pages/migrate-to-threads.mdx +++ b/pages/migrate-to-threads.mdx @@ -1,10 +1,10 @@ --- -title: "Migrating to threads" +title: 'Migrating to threads' --- - This only applies to you if you are using the Plain API or webhooks. If you - are using neither, feel free to ignore this! + This only applies to you if you are using the Plain API or webhooks. If you are using neither, + feel free to ignore this! Furthermore, this migration only applies to you if you use _any_ of the following Plain APIs: @@ -29,9 +29,8 @@ Or if you are using _any_ of the following webhooks : If you run into **any** issues, please reach out to us via the app (**⌘ + K** and then search for "Question") or email us at [help@plain.com](mailto:help@plain.com). - Once you have fully migrated across, please let us know and we will enable a - feature flag for your workspace giving you the full benefits of threads within - Plain. + Once you have fully migrated across, please let us know and we will enable a feature flag for your + workspace giving you the full benefits of threads within Plain. ## New data model diff --git a/pages/security.mdx b/pages/security.mdx index 3a2bac8..c495205 100644 --- a/pages/security.mdx +++ b/pages/security.mdx @@ -1,6 +1,6 @@ --- -title: "Security" -description: "If you or your team have specific questions about how Plain is built, our processes or how we store and handle data please get in touch at help@plain.com." +title: 'Security' +description: 'If you or your team have specific questions about how Plain is built, our processes or how we store and handle data please get in touch at help@plain.com.' --- We are very happy to answer any questions you have. diff --git a/pages/ui-components.mdx b/pages/ui-components.mdx index 8881660..845c2d5 100644 --- a/pages/ui-components.mdx +++ b/pages/ui-components.mdx @@ -1,6 +1,6 @@ --- -title: "UI Component" -sidebarTitle: "Overview" +title: 'UI Component' +sidebarTitle: 'Overview' description: "UI components are a way of describing some UI when using Plain's [Customer Timeline Entries](/pages/custom-timeline-entries)and [Customer Cards](/pages/customer-cards)." --- @@ -18,8 +18,7 @@ For example - this is a button that links to Stripe. and it looks like this: - ![Example button linking to - stripe](/public/images/ui-components/link-button-stripe.png) + ![Example button linking to stripe](/public/images/ui-components/link-button-stripe.png) In the GraphQL API schema, we have two separate unions for Custom Timeline Entry Components and Customer Card diff --git a/pages/ui-components/badge.mdx b/pages/ui-components/badge.mdx index b9af334..e101da7 100644 --- a/pages/ui-components/badge.mdx +++ b/pages/ui-components/badge.mdx @@ -1,6 +1,6 @@ --- -title: "Badge" -description: "Useful for statuses or when you need to attract attention to something." +title: 'Badge' +description: 'Useful for statuses or when you need to attract attention to something.' --- ![Example badges](/public/images/ui-components/badge.png) diff --git a/pages/ui-components/container.mdx b/pages/ui-components/container.mdx index b4ae097..7289734 100644 --- a/pages/ui-components/container.mdx +++ b/pages/ui-components/container.mdx @@ -1,6 +1,6 @@ --- -title: "Container" -description: "Useful when you need to create a bit of structure." +title: 'Container' +description: 'Useful when you need to create a bit of structure.' --- ![Example container](/public//images/ui-components/container.png) diff --git a/pages/ui-components/copy-button.mdx b/pages/ui-components/copy-button.mdx index 8443a3d..0aa72bc 100644 --- a/pages/ui-components/copy-button.mdx +++ b/pages/ui-components/copy-button.mdx @@ -1,11 +1,9 @@ --- -title: "CopyButton" -description: "Useful if you have any IDs or other details you want to copy for use in messages or outside of Plain." +title: 'CopyButton' +description: 'Useful if you have any IDs or other details you want to copy for use in messages or outside of Plain.' --- - - ![Example copy button](/public/images/ui-components/copy-button.png) - +![Example copy button](/public/images/ui-components/copy-button.png) A copy button has the following properties: diff --git a/pages/ui-components/divider.mdx b/pages/ui-components/divider.mdx index 9b6043e..6d3e1f4 100644 --- a/pages/ui-components/divider.mdx +++ b/pages/ui-components/divider.mdx @@ -1,6 +1,6 @@ --- -title: "Divider" -description: "Useful when you need a bit of structure." +title: 'Divider' +description: 'Useful when you need a bit of structure.' --- ![Example divider](/public/images/ui-components/divider.png) diff --git a/pages/ui-components/link-button.mdx b/pages/ui-components/link-button.mdx index 2e9fa00..01da550 100644 --- a/pages/ui-components/link-button.mdx +++ b/pages/ui-components/link-button.mdx @@ -1,11 +1,9 @@ --- -title: "LinkButton" -description: "Useful when you want to link somewhere external (e.g. your own admin tool or payment provider)" +title: 'LinkButton' +description: 'Useful when you want to link somewhere external (e.g. your own admin tool or payment provider)' --- - - ![Example link button](/public/images/ui-components/link-button.png) - +![Example link button](/public/images/ui-components/link-button.png) A link button has the following properties: diff --git a/pages/ui-components/plain-text.mdx b/pages/ui-components/plain-text.mdx index f8b57a5..6c0dd6f 100644 --- a/pages/ui-components/plain-text.mdx +++ b/pages/ui-components/plain-text.mdx @@ -1,11 +1,9 @@ --- -title: "PlainText" -description: "Useful when you want to show any text that should not have any formatting (is not Markdown). If you want markdown please use [Text](/ui-components/text)." +title: 'PlainText' +description: 'Useful when you want to show any text that should not have any formatting (is not Markdown). If you want markdown please use [Text](/ui-components/text).' --- - - ![Example link button](/public/images/ui-components/plain-text.png) - +![Example link button](/public/images/ui-components/plain-text.png) The plain text component has the following properties: diff --git a/pages/ui-components/row.mdx b/pages/ui-components/row.mdx index b1bbd77..2963ec7 100644 --- a/pages/ui-components/row.mdx +++ b/pages/ui-components/row.mdx @@ -1,6 +1,6 @@ --- -title: "Row" -description: "Useful when you need to show two things next to each-other." +title: 'Row' +description: 'Useful when you need to show two things next to each-other.' --- ![Example row](/public/images/ui-components/row.png) diff --git a/pages/ui-components/spacer.mdx b/pages/ui-components/spacer.mdx index 17e0f98..2aa3b25 100644 --- a/pages/ui-components/spacer.mdx +++ b/pages/ui-components/spacer.mdx @@ -1,5 +1,5 @@ --- -title: "Spacer" +title: 'Spacer' --- ![Example spacer](/public/images/ui-components/spacer.png) diff --git a/pages/ui-components/text.mdx b/pages/ui-components/text.mdx index ccb99ca..0a122d2 100644 --- a/pages/ui-components/text.mdx +++ b/pages/ui-components/text.mdx @@ -1,5 +1,5 @@ --- -title: "Text" +title: 'Text' --- ![Example text](/public/images/ui-components/text.png) diff --git a/pages/webhooks.mdx b/pages/webhooks.mdx index a2a0fb2..9740cda 100644 --- a/pages/webhooks.mdx +++ b/pages/webhooks.mdx @@ -1,5 +1,5 @@ --- -title: "Webhooks" +title: 'Webhooks' --- Webhooks allow you to get notified about events happening in your Plain workspace. You can react to these events in many ways, such as: @@ -28,14 +28,14 @@ to receive and whether you want to enable it straight away. You can create up to **25 webhook targets** per workspace. - Plain events may contain Personally Identifiable Information (PII). If you - want to test webhooks with a production workspace, take the necessary - precautions to avoid leaking PII to untrusted parties. + Plain events may contain Personally Identifiable Information (PII). If you want to test webhooks + with a production workspace, take the necessary precautions to avoid leaking PII to untrusted + parties. - We have created a repository where you will find instructions on how to create - a webhook endpoint using different programming languages. You can find it + We have created a repository where you will find instructions on how to create a webhook endpoint + using different programming languages. You can find it [here](https://github.com/team-plain/webhooks-resources/tree/main/servers). diff --git a/pages/webhooks/customer-created.mdx b/pages/webhooks/customer-created.mdx index 9425295..78ccc3a 100644 --- a/pages/webhooks/customer-created.mdx +++ b/pages/webhooks/customer-created.mdx @@ -1,6 +1,6 @@ --- -title: "Customer created" -description: "This event is fired when a new customer is created in your workspace." +title: 'Customer created' +description: 'This event is fired when a new customer is created in your workspace.' --- ## Schema diff --git a/pages/webhooks/customer-deleted.mdx b/pages/webhooks/customer-deleted.mdx index 0785c36..95c7dfa 100644 --- a/pages/webhooks/customer-deleted.mdx +++ b/pages/webhooks/customer-deleted.mdx @@ -1,6 +1,6 @@ --- -title: "Customer deleted" -description: "This event is fired when a customer is deleted from your workspace." +title: 'Customer deleted' +description: 'This event is fired when a customer is deleted from your workspace.' --- ## Schema diff --git a/pages/webhooks/customer-group-membership-changed.mdx b/pages/webhooks/customer-group-membership-changed.mdx index dabb07e..a1bd6ad 100644 --- a/pages/webhooks/customer-group-membership-changed.mdx +++ b/pages/webhooks/customer-group-membership-changed.mdx @@ -1,6 +1,6 @@ --- -title: "Customer Group Membership Changed Event" -description: "This event is fired whenever a customer is added or removed from a customer group." +title: 'Customer Group Membership Changed Event' +description: 'This event is fired whenever a customer is added or removed from a customer group.' --- The [`changeType`](https://json-schema.app/view/%23%2Fdefinitions%2FcustomerGroupMembershipsChangedPayload?url=https%3A%2F%2Fcore-api.uk.plain.com%2Fwebhooks%2Fschema.json) field allows you to know what kind of change has occurred. It can be one of the following: diff --git a/pages/webhooks/customer-updated.mdx b/pages/webhooks/customer-updated.mdx index d0ded95..d80aeee 100644 --- a/pages/webhooks/customer-updated.mdx +++ b/pages/webhooks/customer-updated.mdx @@ -1,6 +1,6 @@ --- -title: "Customer updated" -description: "This event is fired when a customer is updated in your workspace. You can expect this event:" +title: 'Customer updated' +description: 'This event is fired when a customer is updated in your workspace. You can expect this event:' --- - when a customer is marked as spam diff --git a/pages/webhooks/email-received.mdx b/pages/webhooks/email-received.mdx index ab540cc..a4570d3 100644 --- a/pages/webhooks/email-received.mdx +++ b/pages/webhooks/email-received.mdx @@ -1,14 +1,13 @@ --- -title: "Email received" -description: "This event is fired when an email is received in your workspace." +title: 'Email received' +description: 'This event is fired when an email is received in your workspace.' --- - An important field that might go unnoticed is `isStartOfThread`. This will - tell you if this email is the first message of a thread or not, which is - useful if you want to build some auto-reply logic. If you want to build an - auto-responder that *only replies* to the first message of a thread, please - check [`thread.thread_created`](/webhooks/thread-created) instead. + An important field that might go unnoticed is `isStartOfThread`. This will tell you if this email + is the first message of a thread or not, which is useful if you want to build some auto-reply + logic. If you want to build an auto-responder that *only replies* to the first message of a + thread, please check [`thread.thread_created`](/webhooks/thread-created) instead. ## Schema diff --git a/pages/webhooks/email-sent.mdx b/pages/webhooks/email-sent.mdx index 7422032..1a2218d 100644 --- a/pages/webhooks/email-sent.mdx +++ b/pages/webhooks/email-sent.mdx @@ -1,14 +1,13 @@ --- -title: "Email received" -description: "This event is fired when an email is received in your workspace." +title: 'Email received' +description: 'This event is fired when an email is received in your workspace.' --- - An important field that might go unnoticed is `isStartOfThread`. This will - tell you if this email is the first message of a thread or not, which is - useful if you want to build some auto-reply logic. If you want to build an - auto-responder that *only replies* to the first message of a thread, please - check [`thread.thread_created`](/webhooks/thread-created) instead. + An important field that might go unnoticed is `isStartOfThread`. This will tell you if this email + is the first message of a thread or not, which is useful if you want to build some auto-reply + logic. If you want to build an auto-responder that *only replies* to the first message of a + thread, please check [`thread.thread_created`](/webhooks/thread-created) instead. ## Schema diff --git a/pages/webhooks/thread-assignment-transitioned.mdx b/pages/webhooks/thread-assignment-transitioned.mdx index d31fcda..45f3ea8 100644 --- a/pages/webhooks/thread-assignment-transitioned.mdx +++ b/pages/webhooks/thread-assignment-transitioned.mdx @@ -1,6 +1,6 @@ --- -title: "Thread assignment transitioned" -description: "This event is fired when the assignee of a thread changes or a thread is unassigned." +title: 'Thread assignment transitioned' +description: 'This event is fired when the assignee of a thread changes or a thread is unassigned.' --- ## Schema diff --git a/pages/webhooks/thread-created.mdx b/pages/webhooks/thread-created.mdx index ff35fdf..654b88d 100644 --- a/pages/webhooks/thread-created.mdx +++ b/pages/webhooks/thread-created.mdx @@ -1,18 +1,17 @@ --- -title: "Thread created" -description: "This event is fired when a new thread is created in your workspace." +title: 'Thread created' +description: 'This event is fired when a new thread is created in your workspace.' --- You can subscribe to this event **if you want to build an auto-responder**. To do so, when you receive this event, use the `replyToThread` mutation to send a reply back to the customer. - Every email you receive in your workspace is linked to a thread. If we cannot - find a matching thread for an email, we will create one. When this happens, - you may receive two events: `thread.thread_created` and - [`thread.email_received`](/webhooks/email-received) (depending on your webhook - target event subscriptions). If you do, and you only care about emails which - are not the first message of the thread, please check the `isStartOfThread` in - the [`thread.email_received`](/webhooks/email-received) payload. + Every email you receive in your workspace is linked to a thread. If we cannot find a matching + thread for an email, we will create one. When this happens, you may receive two events: + `thread.thread_created` and [`thread.email_received`](/webhooks/email-received) (depending on your + webhook target event subscriptions). If you do, and you only care about emails which are not the + first message of the thread, please check the `isStartOfThread` in the + [`thread.email_received`](/webhooks/email-received) payload. ## Schema diff --git a/pages/webhooks/thread-labels-changed.mdx b/pages/webhooks/thread-labels-changed.mdx index 63243fb..a45a422 100644 --- a/pages/webhooks/thread-labels-changed.mdx +++ b/pages/webhooks/thread-labels-changed.mdx @@ -1,6 +1,6 @@ --- -title: "Thread labels changed" -description: "This event is fired when labels are added to or removed from a thread." +title: 'Thread labels changed' +description: 'This event is fired when labels are added to or removed from a thread.' --- ## Schema diff --git a/pages/webhooks/thread-priority-changed.mdx b/pages/webhooks/thread-priority-changed.mdx index ea7747b..59ce4e6 100644 --- a/pages/webhooks/thread-priority-changed.mdx +++ b/pages/webhooks/thread-priority-changed.mdx @@ -1,6 +1,6 @@ --- -title: "Thread priority changed" -description: "This event is fired when the priority of a thread changes." +title: 'Thread priority changed' +description: 'This event is fired when the priority of a thread changes.' --- ## Schema diff --git a/pages/webhooks/thread-status-transitioned.mdx b/pages/webhooks/thread-status-transitioned.mdx index 96bb59f..f1cc945 100644 --- a/pages/webhooks/thread-status-transitioned.mdx +++ b/pages/webhooks/thread-status-transitioned.mdx @@ -1,6 +1,6 @@ --- -title: "Thread status transitioned" -description: "This event is fired when the status of a thread changes." +title: 'Thread status transitioned' +description: 'This event is fired when the status of a thread changes.' --- ## Schema