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

[Multi Hub] Tab Mail Sample #838

Closed
wants to merge 12 commits into from
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDev
|21| Personal Tab with Nav-Bar menu | Add multiple actions to the upper right in Nav-Bar and build an overflow menu for extra actions in an app. ||[View][tab-navbar-menu#ts]|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build and deploy pipelines are missing for this new sample.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mohammed-MSFT - Deploy pipeline is still missing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

|22| App Caching in Meetings | This sample shows how to improve the subsequent loading time of an App. |||[View][app-cache-meetings#nodejs]|
|23| Personal Tab with Nav-Bar menu | Add multiple actions to the upper right in Nav-Bar and build an overflow menu for extra actions in an app. ||[View][tab-navbar-menu#ts]|
|24| Tab Mail In Outlook | This sample app shows how to compose mail using perosnal tab in outlook ||[View][tab-mail#ts]|
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved

## [Bots samples](https://docs.microsoft.com/microsoftteams/platform/bots/what-are-bots) (using the v4 SDK)
>NOTE:
Expand Down Expand Up @@ -238,6 +239,7 @@ The [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDev
[tab-request-approval#nodejs]:samples/tab-request-approval/nodejs
[bot-request-approval#nodejs]:samples/bot-request-approval/nodejs
[tab-navbar-menu#ts]:samples/tab-navbar-menu/ts
[tab-mail#ts]:samples/tab-mail/ts

[group-channel-tab#cs#razor]:samples/tab-channel-group/razor-csharp
[group-channel-tab#cs#mvc]:samples/tab-channel-group/mvc-csharp
Expand Down
1 change: 1 addition & 0 deletions samples/tab-mail/ts/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=3978
Binary file added samples/tab-mail/ts/Images/1.add_app_teams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/tab-mail/ts/Images/2.teams_mail_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/tab-mail/ts/Images/3.app_outlook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/tab-mail/ts/Images/4.compose_mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/tab-mail/ts/Images/tab-mail.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/tab-mail/ts/Manifest/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions samples/tab-mail/ts/Manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"version": "1.0.0",
"id": "{{Manifest-Id}}",
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
"packageName": "com.mail.outlook",
"developer": {
"name": "Microsoft",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.teams.com/privacy",
"termsOfUseUrl": "https://www.teams.com/termsofuser"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Tab-Mail",
"full": "Tab Mail React js"
},
"description": {
"short": "Tab Mail In Outlook",
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
"full": "This sample shows how to compose mail using tab in outlook"
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
},
"accentColor": "#5558AF",
"staticTabs": [
{
"contentUrl": "https://{{domain-name}}/tab",
"websiteUrl": "https://{{domain-name}}/tab",
"entityId": "com.contoso.tabmail.help",
"name": "Tab-Mail",
"scopes": [
"personal"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"*.ngrok-free.app"
]
}
Binary file added samples/tab-mail/ts/Manifest/outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions samples/tab-mail/ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
page_type: sample
description: Sample tab-mail app.
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
products:
- office-teams
- office
- office-365
languages:
- typescript
extensions:
contentType: samples
createdDate: "20/06/2023 01:38:27 PM"
urlFragment: officedev-microsoft-teams-samples-tab-mail-ts
---

# Tab-Mail

This sample helps to compose mail from perosnal tab.
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved

## Included Features
* Tabs

## Interaction with app

![Tab-Mail](Images/tab-mail.gif)
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites
- [NodeJS](https://nodejs.org/en/)

- [M365 developer account](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/prepare-your-o365-tenant) or access to a Teams account with the appropriate permissions to install an app.
- [Ngrok](https://ngrok.com/download) (For local environment testing) Latest (any other tunneling software can also be used)

- [Teams](https://teams.microsoft.com) Microsoft Teams is installed and you have an account

## Setup

1. Setup NGROK
- Run ngrok - point to port 3978

```bash
ngrok http 3978 --host-header="localhost:3978"
```
2. Setup for code
- Clone the repository

```bash
git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
```

- In a terminal, navigate to `samples/tab-mail/ts`

- Install modules

```bash
npm install
```
- Run your app

```bash
npm start
```
3. Setup Manifest for Teams

- **This step is specific to Teams.**
**Edit** the `manifest.json` contained in the `Manifest/` folder to replace with your Manifest-Id *everywhere* you see the place holder string `{{Manifest-Id}}`.
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
**Edit** the `manifest.json` for `validDomains` and replace `{{domain-name}}` with base Url of your domain. E.g. if you are using ngrok it would be `https://1234.ngrok-free.app` then your domain-name will be `1234.ngrok-free.app`.
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
**Zip** up the contents of the `Manifest/` folder to create a `manifest.zip`.
**Upload** the `manifest.zip` to Teams (in the left-bottom *Apps* view, click "Upload a custom app")


## Running the sample

**Install App:**

![InstallApp](Images/1.add_app_teams.png)

**App In Teams:**

![Tab-Mail](Images/2.teams_mail_form.png)

**App In Outlook**

![OpenOutlook](Images/3.app_outlook.png)

**Compose Mail From Tab**

![Compose Mail](Images/4.compose_mail.png)

## Further Reading.
[tab-mail](https://learn.microsoft.com/en-us/javascript/api/@microsoft/teams-js/mail?view=msteams-client-js-latest)

ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved

<img src="https://pnptelemetry.azurewebsites.net/microsoft-teams-samples/samples/tab-mail-ts" />
68 changes: 68 additions & 0 deletions samples/tab-mail/ts/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
"name": "officedev-microsoft-teams-samples-tab-mail-ts",
"source": "officeDev",
"title": "Tab Mail In Outlook",
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
"shortDescription": "This sample helps to compose mail from perosnal tab",
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
"url": "https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/tab-calendar/ts",
"longDescription": [
"This sample app shows how to compose mail using perosnal tab."
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
],
"creationDateTime": "2023-06-19",
"updateDateTime": "2023-06-10",
"products": [
"Teams"
],
"metadata": [
{
"key": "TEAMS-SAMPLE-SOURCE",
"value": "OfficeDev"
},
{
"key": "TEAMS-SERVER-LANGUAGE",
"value": "reactjs"
},
{
"key": "TEAMS-SERVER-PLATFORM",
"value": "reactjs"
},
{
"key": "TEAMS-FEATURES",
"value": "tab"
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/OfficeDev/Microsoft-Teams-Samples/main/samples/tab-mail/ts/Images/tab-mail.gif",
"alt": "Solution UX showing Tab Mail support in Outlook apps."
ChetanSharma-msft marked this conversation as resolved.
Show resolved Hide resolved
}
],
"authors": [
{
"gitHubAccount": "OfficeDev",
"pictureUrl": "https://avatars.githubusercontent.com/u/6789362?s=200&v=4",
"name": "OfficeDev"
}
],
"references": [
{
"name": "Teams developer documentation",
"url": "https://aka.ms/TeamsPlatformDocs"
},
{
"name": "Teams developer questions",
"url": "https://aka.ms/TeamsPlatformFeedback"
},
{
"name": "Teams development videos from Microsoft",
"url": "https://aka.ms/sample-ref-teams-vids-from-microsoft"
},
{
"name": "Teams development videos from the community",
"url": "https://aka.ms/sample-ref-teams-vids-from-community"
}
]
}
]
Loading