Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
This sample shows a feature where user can schedule a task from messaging extension action and get a reminder card at a scheduled time.
office-teams
office
office-365
nodejs
contentType createdDate
samples
11/24/2021 12:00:00 AM
officedev-microsoft-teams-samples-msgext-message-reminder-nodejs

Message reminder with messaging extension action

This sample shows a feature where user can schedule a task from messaging extension action and get a reminder card at a scheduled time.

Interaction with app

Task Details

Prerequisites

  • Microsoft Teams is installed and you have an account (not a guest account)
  • NodeJS
  • ngrok or equivalent tunneling solution
  • M365 developer account or access to a Teams account with the appropriate permissions to install an app.

Setup

  1. Register a new application in the Azure Active Directory – App Registrations portal.

  2. Setup for Bot

  • In Azure portal, create a Azure Bot resource.
  • Ensure that you've enabled the Teams Channel
  • While registering the bot, use https://<your_ngrok_url>/api/messages as the messaging endpoint. NOTE: When you create app registration, you will create an App ID and App password - make sure you keep these for later.
  1. Setup NGROK
  • Run ngrok - point to port 3978

    ngrok http -host-header=rewrite 3978
  1. Setup for code

    • Clone the repository
    git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
    • Update the .env configuration for the bot to use the MicrosoftAppId and MicrosoftAppPassword, BaseUrl with application base url. For e.g., your ngrok url. (Note the MicrosoftAppId is the AppId created in step 1 (Setup for Bot), the MicrosoftAppPassword is referred to as the "client secret" in step 1 (Setup for Bot) and you can always create a new client secret anytime.)
  • In the folder where repository is cloned navigate to samples/bot-task-reminder/nodejs

  • Install modules

    npm install
  1. Run your app

    npm start
  2. Setup Manifest for Teams

  • This step is specific to Teams.

    • Edit the manifest.json contained in the ./AppPackage folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) everywhere you see the place holder string {{Microsoft-App-Id}} (depending on the scenario the Microsoft App Id may occur multiple times in the manifest.json)
    • 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.io then your domain-name will be 1234.ngrok.io.
    • Zip up the contents of the AppPackage folder to create a manifest.zip (Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package)
  • Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")

    • Go to Microsoft Teams. From the lower left corner, select Apps
    • From the lower left corner, choose Upload a custom App
    • Go to your project directory, the ./AppPackage folder, select the zip folder, and choose Open.
    • Select Add in the pop-up dialog box. Your app is uploaded to Teams.

Running the sample

  • Personal scope scenario Select ... over message to get action create-reminder for scheduling task.

Select message

Task module to schedule a task.

Task Details

Reminder card of task at scheduled date and time.

Task reminder

  • Team scope scenario Navigate to team where the app is installed

Select ... over message to get action create-reminder for scheduling task.

Team message action

Task module to schedule a task.

Team Task Details

Reminder card of task at scheduled date and time.

 TeamTask reminder

Further reading