Setup Document
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
- About the Project
- Prerequisites
- Getting Started
- Usage
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
This is a Outlook Web App (OWA) Add-in designed during my internship at Direct Supply! The ultimate goal of this project is to create an add-in that can maximize a user's mailbox space through the deletion of attachments and unnecessary email threads.
Currently the add-in can:
- Login users to Outlook accounts and leverage Microsoft Graph / Google APIs.
- Delete duplicate emails in conversations threads.
- Save attachments to OneDrive / Google Drive, delete from email, and embed a hyperlink to attachment location in email.
- Can do the above save, delete, and embed on an entire mail folder (Inbox).
- All with the single click of a button! 😄
A list of commonly used resources that I find helpful are listed in the acknowledgements.
This section lists the major frameworks that my project uses.
- JQuery
- Graph API
- Google Drive API
- Outlook Mail API Used for email editing
- ASP.NET MVC Using C# of course
- OAuth 2.0 - Authorization Code Flow For getting AcessTokens
- MSAL .NET Library
Before getting started there are a few requirements you must ensure are fulfilled before beginning.
You should have:
- Visual Studio 2019
- Access to Office 365 tenant or Outlook.com account that can use Azure Active Directory admin center for registering the app.
- Failure to use a developer account will result in Graph API call not working and in a MailboxNotEnabledForRESTAPI error
- See Overview for REST APIs for more details.
- Patience 😤
Alright, time to begin
-
First you will need to register the application in the Microsoft Application Registration Portal in order to obtain an app ID for accessing the Microsoft Graph API.
- Log in with the identity of an administrator of your Office 365 tenancy to ensure that you are working in an Azure Active Directory that is associated with that tenancy . See Register an application with the Microsoft Identity Platform
- There click the Go to app list button and then the Add an app button. Enter a name for the application and click Create application.
- Locate the Application Secrets section, and click Generate New Password. A dialog box will appear with the generated password. Copy this value and save it somewhere secure. After leaving this page, you will no longer be able to access this password.
- Locate the Platforms section, and click Add Platform. Choose Web, then enter 'https://localhost:44301/AzureADAuth/Authorize' under Redirect URIs.
Note: The port number in the redirect URI (
44301
) may be different on your development machine. You can find the correct port number for your machine by selecting the Outlook-Add-in-Microsoft-GraphASPNETWeb project in Solution Explorer, then looking at the SSL URL setting under Development Server in the properties window. Verify that SSL Enabled is True.- Locate the Microsoft Graph Permissions section in the app registration. Next to Delegated Permissions, click Add. Select Files.ReadWrite.All, Mail.ReadWrite, User.Read. Next to Application Permissions grant the following: email, Mail.ReadWrite, offline_access, openid, and profile.
-
Ensure the following settings are used:
- SUPPORTED ACCOUNT TYPES: "Accounts in this organizational directory only"
- IMPLICIT GRANT: Do not enable any Implicit Grant options
Here's an example of what the page should look like when your done.
Edit Web.config and replace 'YOUR APP ID HERE' with the application ID and 'YOUR APP PASSWORD HERE' with the application secret you generated at the beginning. Also replace 'YOUR TENANT ID HERE' with the directory tenant ID found on the app registration site.
Optional - For Configuring Google Drive Saving
Follow steps (1-4) found Here. Ignore step 3c.
-
Open the Visual Studio solution file.
-
Right-click Outlook-Add-in-Microsoft-Graph-ASPNET solution in Solution Explorer (not the project nodes), and then choose Set startup projects. Select the Multiple startup projects radio button. Make sure the project that ends with "Web" is listed first.
-
On the Build menu, select Clean Solution. When it finishes, open the Build menu again and select Build Solution.
-
In Solution Explorer, select the Outlook-Add-in-Microsoft-Graph-ASPNET project node (not the top solution node and not the project whose name ends in "Web").
-
Press F5. The first time you do this, you will be prompted to specify the email and password of the user that you will use for debugging the add-in. Use the credentials of an admin for your O365 tenancy.
NOTE: The browser will open to the login page for Office on the web. (So, if this is the first time you have run the add-in, you will enter the username and password twice.)
The remaining steps depend on whether you are running the add-in in desktop Outlook or Outlook on the web.
-
Outlook for Web will open in a browser window. In Outlook, click on any email.
-
On the right when you click the ... button on this tool bar the following icon should appear.
-
Click the icon to open the task pane add-in.
TODO:
Here is a walkthrough of what the app looks like currently.
1.) Load email via VS
2.) Click on the ... button on the right of an email for this menu to appear.
3.) After clicking the Direct Supply icon, the add-in show look like this. Sign in with your email account.
4.) After signing in, the menu should look like this. Now you can click on the commands to get started!
For more examples, please refer to the Documentation
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Jeffrey Keyser - jeff.keyser@outlook.com
Project Link: Direct Supply Add-in