Skip to content

Commit

Permalink
Run Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmikolay committed Nov 20, 2024
1 parent b5af62c commit acbd9ad
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 33 deletions.
19 changes: 13 additions & 6 deletions content/integrations/chat/microsoft-teams/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ Here's an example of setting channel data on an `Object` in Knock.
<>
<span className="font-bold">Potential confusion alert.</span> In the
example above, the <code>KNOCK_TEAMS_CHANNEL_ID</code> variable is the id
of the Knock channel you've created to represent your Microsoft Teams integration within the
Knock dashboard. You can find it by going to{" "}
of the Knock channel you've created to represent your Microsoft Teams
integration within the Knock dashboard. You can find it by going to{" "}
<span className="font-bold">Integrations</span> {">"}{" "}
<span className="font-bold">Channels</span> in the Knock dashboard and
then copying the ID of your Microsoft Teams channel.
Expand All @@ -89,9 +89,9 @@ Here's an example of setting channel data on an `Object` in Knock.

Here's an overview of the data requirements for [setting recipient channel data](/send-notifications/setting-channel-data) for either an incoming webhook URL or a Microsoft Teams bot connection. Both will need to live under the `connections` key.

| Property | Type | Description |
| ----------- | ---------------------- | ------------------------------------------ |
| connections | `MsTeamsConnection[]` | One or more connections to Microsoft Teams |
| Property | Type | Description |
| ----------- | --------------------- | ------------------------------------------ |
| connections | `MsTeamsConnection[]` | One or more connections to Microsoft Teams |

An `MsTeamsConnection` can have one of two schemas, depending on whether you're using a Microsoft Teams bot or an incoming webhook.

Expand Down Expand Up @@ -126,11 +126,13 @@ Depending on the Microsoft Teams integration you build into your product, you'll
If your integration involves a user opting in to receive direct messages from your Microsoft Teams integration, you’ll be storing the channel data [on that user](/reference#set-user-channel-data) in Knock. When you want to notify this user, you'll include them as a recipient in a Knock workflow trigger.

For this integration, you'll store a user's Microsoft Teams `ms_teams_user_id` in the `MsTeamsConnection` object.

</Accordion>
<Accordion title="Objects" description="For notifying Microsoft Teams channels about non-user resources">
If your integration involves a customer connecting a _non-user resource_ in their product (such as a project or a page) to a Microsoft Teams channel, you’ll want to store that channel data [on an object](/reference#set-object-channel-data) in Knock, as it’s not specific to any single user.

For this integration, you'll store a Microsoft Teams `ms_teams_channel_id` in the `MsTeamsConnection` object.

</Accordion>
</AccordionGroup>

Expand All @@ -148,7 +150,12 @@ To switch to the JSON editor in the Knock template designer, look for the "Switc

<Callout
emoji="⚠️"
text={<><strong>Note:</strong> We do not support adaptive card previews in Knock at this time.</>}
text={
<>
<strong>Note:</strong> We do not support adaptive card previews in Knock
at this time.
</>
}
/>

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,16 @@ In your `manifest.json` file, add `personal` to your bot's array of scopes:

```json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "{{YOUR_TEAMS_APP_ID}}",
"bots": [
{
"botId": "{{YOUR_BOT_ID}}",
"scopes": [
"personal",
],
}
]
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "{{YOUR_TEAMS_APP_ID}}",
"bots": [
{
"botId": "{{YOUR_BOT_ID}}",
"scopes": ["personal"]
}
]
}
```

Expand Down Expand Up @@ -110,7 +108,7 @@ export class TeamsBot extends TeamsActivityHandler {
.setChannelData(
"user_1n38knd",
process.env.KNOCK_MS_TEAMS_CHANNEL_ID,
{ connections: [{ ms_teams_user_id: msTeamsUserId }]},
{ connections: [{ ms_teams_user_id: msTeamsUserId }] },
)
.catch(console.error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,16 @@ In your `manifest.json` file, add `team` to your bot's array of scopes:

```json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "{{YOUR_TEAMS_APP_ID}}",
"bots": [
{
"botId": "{{YOUR_BOT_ID}}",
"scopes": [
"team",
],
}
]
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "{{YOUR_TEAMS_APP_ID}}",
"bots": [
{
"botId": "{{YOUR_BOT_ID}}",
"scopes": ["team"]
}
]
}
```

Expand All @@ -128,7 +126,7 @@ await knockClient.objects.setChannelData(
"repositories",
"knocklabs/javascript",
process.env.KNOCK_MS_TEAMS_CHANNEL_ID,
{ connections: [{ ms_teams_channel_id: msTeamsChannelId }]},
{ connections: [{ ms_teams_channel_id: msTeamsChannelId }] },
);
```

Expand All @@ -139,7 +137,12 @@ Here, `KNOCK_MS_TEAMS_CHANNEL_ID` is the channel ID of your Microsoft Teams inte
text={
<>
<strong>Note: </strong>
Make sure your Microsoft Teams app has been <a href="https://support.microsoft.com/en-us/office/add-an-app-to-microsoft-teams-b2217706-f7ed-4e64-8e96-c413afd02f77" target="_blank">added to the team</a> associated with the <code>Tenant</code> before you send notifications.
Make sure your Microsoft Teams app has been <a
href="https://support.microsoft.com/en-us/office/add-an-app-to-microsoft-teams-b2217706-f7ed-4e64-8e96-c413afd02f77"
target="_blank"
>
added to the team
</a> associated with the <code>Tenant</code> before you send notifications.
</>
}
/>
Expand Down

0 comments on commit acbd9ad

Please sign in to comment.