Code Monkey home page Code Monkey logo

outlook-add-in-contextual-regex's Introduction

page_type products languages extensions
sample
office-365
office-outlook
javascript
contentType technologies createdDate
samples
Add-ins
1/11/2018 1:18:43 PM

Outlook Add-in: Contoso Order Number

This sample add-in demonstrates how to create a contextual add-in that activates when a regular expression match is detected in the body of a message.

The add-in detects fictitious Contoso order numbers with a specific format. The format used is CO- followed by 9 digits. When activated, the add-in simply displays both the selected order number and a list of all detected order numbers in the message.

Note: Getting the selected order number relies on an API currently in preview, so it may not be available in all clients. If it is not, the add-in will indicate that it is not supported.

Prerequisites

In order to try this add-in, you'll need:

  • Office 365: If you don't already have Office 365, you can register for a free 1-month trial.
  • An SSL-protected web server: This can be any web server with an SSL certificate trusted by your client. If you don't have access to a web server, see Running the add-in locally for steps to run a basic web server from the command line using Node.js and NPM.

Configure the add-in

  1. Unless you are going to run the add-in locally, copy the HTML, CSS, JavaScript, and PNG files from the project to your web server, maintaining the same directory layout.

  2. Open the manifest (contoso-order-number-manifest.xml) in a text editor and replace all instances of https://localhost:8080 with the URL to the directory where you copied the files in the previous step.

  3. Verify that you can browse to the updated URLs in your manifest from your client using a browser. For example, you should be able to browse to the URL in the <bt:Url id="detectedEntityURL"> element in the manifest and see the following page:

    A screenshot of the add-in's index.html page loaded in a browser

Sideload the add-in

Follow the instructions at Sideload Outlook add-ins for testing to sideload the contoso-order-number-manifest.xml file.

Try it out

  1. Open Outlook on the web.

  2. Send yourself a message with a Contoso order number in the body. For example:

    Thanks for your order! Your order number is CO-123456789.
    
  3. When the message arrives in your inbox, open it. The order number should be highlighted. Click on the order number to open the add-in.

    A screenshot of the add-in activated in Outlook on the web

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Copyright

Copyright (c) Microsoft. All rights reserved.

outlook-add-in-contextual-regex's People

Contributors

o365devx avatar microsoftopensource avatar jasonjoh avatar msftgits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.