Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs fixes #28

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions _snippets/typescript-sdk/reply-to-thread.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```tsx
import { PlainClient } from '@team-plain/typescript-sdk';

const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });

const res = await client.replyToThread({
threadId: 'th_01HD1G6649R1DK061W27VBT7QB',
textContent: 'The plain text version of your reply goes here.',
markdownContent: 'The markdown **version** of your _reply_ goes here.',
});

if (res.error) {
console.error(res.error);
} else {
console.log(res.data);
}
```
9 changes: 1 addition & 8 deletions api-reference/graphql/messaging/reply-to-thread.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ You can reply to a thread using the `replyToThread` mutation. The call to this m

If it is not possible to reply to this thread, you will get the mutation error code [`cannot_reply_to_thread`](/api-reference/graphql/error-codes#cannot_reply_to_thread) and a message indicating why.

<Info>
Using the `replyToThread` mutation is the recommended way to create a simple auto-responder with
Plain. To do it, you should subscribe to the
[`thread.thread_created`](/api-reference/webhooks/thread-created) event and use use this mutation
whenever you get this event.
</Info>

<Tabs>
<Tab title="Typescript SDK">
Only one permission is needed:
Expand All @@ -24,7 +17,7 @@ If it is not possible to reply to this thread, you will get the mutation error c

<Snippet file="typescript-sdk/reply-to-thread.mdx" />

Where `result.data` is:
Where `res.data` is:

<Snippet file="typescript-sdk/reply-to-thread-response.mdx" />

Expand Down
2 changes: 1 addition & 1 deletion api-reference/graphql/messaging/send-email.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Send new emails'
---

You can send new outbound emails to customers with the `sendNewEmail` API. This is useful for proactively reaching out about issues.
As well as creating outbound emails in the UI you can also send them with the `sendNewEmail` API. This is useful for proactively reaching out about issues.

<Tabs>
<Tab title="Typescript SDK">
Expand Down
Loading