GithubHelp home page GithubHelp logo

isabella232 / outlook-add-in-on-send Goto Github PK

View Code? Open in Web Editor NEW

This project forked from officedev/outlook-add-in-on-send

0.0 0.0 0.0 166 KB

Learn how to check for restricted words in an Outlook email message body, add a recipient to the CC line and check that there is a subject in the email on send.

License: MIT License

CSS 12.35% JavaScript 87.65%

outlook-add-in-on-send's Introduction

page_type products languages extensions
sample
office-outlook
office-365
javascript
contentType technologies createdDate
samples
Add-ins
3/20/2017 11:55:13 PM

Outlook add-in on send code sample

Learn how to check for restricted words in an Outlook email message body, add a recipient to the CC line and check that there is a subject in the email on send.

Note:

Table of Contents

Change history

April 2017

  • Initial version.

Prerequisites

  • A trusted web server to host the sample files. The server must be able to accept SSL-protected requests (https) and have a valid SSL certificate.
  • An Office 365 email account.
  • Enable the on send feature - by default, the on send functionality is disabled. Add-ins for Outlook on the web that use the on send feature will run for users who are assigned an Outlook on the web mailbox policy that has the OnSendAddinsEnabled flag set to true. Administrators can enable on send by running Exchange Online PowerShell cmdlets. To learn what cmdlets to run, see Installing Outlook add-ins that use on send

Configuring and installing the sample

  1. Download or fork the repository.

  2. Open app.js. In addCCOnSend function, change [email protected] to your own email address.

  3. Deploy the add-in files to a directory on your web server. The files to upload are app.js and index.html.

  4. Open Contoso Message Body Checker.xml and Contoso Subject and CC Checker.xml manifest files in a text editor. Replace all instances of https://localhost:3000 with the HTTPS URL of the directory where you uploaded the files in the previous step. Save your changes.

    For more information about:

Upload the manifests

  1. Logon to Outlook Web App.
  2. Click Settings (the gear cog in the upper right corner of the page) to open the Settings page (as shown in the following screenshot).

The settings page

  1. In Your app settings section of the Settings page, choose Mail.
  2. In the Options page, select General and then Manage add-ins (as shown in the following screenshot).

The manage add-ins page

  1. On the Manage add-ins page, click the '+' icon, select Add from file. Browse to the Contoso Message Body Checker.xml manifest file included in the project. Click Next, then click Install. Finally, click OK.
  2. Repeat step 5 to install Contoso Subject and CC Checker.xml manifest file.
  3. Return to the Mail view in Outlook Web App.

Run the add-in

Subject and CC Checker

  1. Compose a new Outlook Web App email message.
  2. Leave the subject line blank.
  3. Add a recipient in the To line.
  4. Click Send.
  • A carbon copy is added to the CC line. In this sample, it's [email protected].
  • The email is blocked from being sent and an error message displayed on the information bar to notify sender to add a subject. (as shown in the following screenshot).

The subject and CC checker information bar

  1. Add a subject line.
  2. A [Checked]: is added to the front of the subject line and email is sent.

Message Body Checker

  1. Create a new Outlook Web App email message.
  2. In the body of the message, type blockedword, blockedword1 or blockedword2. (These are the array of restricted words in the app.js file of the checkBodyOnlyOnSendCallBack function).
  3. Add a recipient in the To line.
  4. Click Send.
  • The email is blocked from being sent because of blocked words found in the message body.
  • An error message displayed on the information bar to notify sender of blocked words found (as shown in the following screenshot).

The message body checker information bar

  1. To send the email, remove the blocked words.

Questions and comments

We'd love to get your feedback about this sample. You can send your feedback to us in the Issues section of this repository.

Questions about Microsoft Office 365 development in general should be posted to Stack Overflow. If your question is about the Office JavaScript APIs, make sure that your questions are tagged with [office-js] and [API].

Additional resources

Copyright

Copyright (c) 2016 Microsoft Corporation. All rights reserved.

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.

outlook-add-in-on-send's People

Contributors

davidchesnut avatar lauragra avatar microsoftopensource avatar msftgits avatar o365devx 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.