hack-together icon indicating copy to clipboard operation
hack-together copied to clipboard

Project: HackTheCalendar - a Hack-Together project

Open SomebodyToLove1337 opened this issue 1 year ago • 2 comments

Project name

HackTheCalendar - a Hack-Together project

Description

Project Name

HackTheCalendar

Description

This is a simple console application built using .NET v7.0 that connects to your calendar via Microsoft Graph, to determine if their are any out-of-office events scheduled. If so, the app will automatically update the AutomaticReplySettings of the user's mailbox to schedule an Out-Of-Office notice.

How it works:

First you need to create an Azure app as explained in this article: https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal You also need to set up a client secret. You can find the description for this under "Option 2: Create a new application secret" in the article linked above.

After that you have to set the necessary permissions:

  • Calendars.ReadWrite (Application)
  • Mail.Send (Application)
  • MailboxSettings.ReadWrite (Application)

image

you will find a config file "appsettings.json" here you have to adjust the following values:

{
    "Connect": {
      "AzureTenantID" : "YOUR-TENANT-ID", 
      "AzureClientID": "YOUR-CLIENT-ID",
      "AzureClientSecret" : "YOUR-CLIENT-SECRET" 
      },

Then the app should basically run.

You can find more customization options in the config:

"UserConf": {
        "MailSubject": "Vacation",
        "UserID": { "[email protected]",
        "ExternalMessage": "Greetings! Thank you for your email. Im out of the office from [start] until [end]. Ill reply to your email as soon as I can upon my return.",
        "InternalMessage": "Hello colleagues, im out of the office till [end]."
      }

Here you can set which appointments the program should search for. Here it would be appointments which start with the word "Vacation". Then you can specify multiple email addresses which will be checked.

You can also specify a text for the internal as well as for the external notification.

TODO

I would like to work on the app some more to continue learning. Therefore I would like to set todo's here which we will work on in the future:

  • Provide app additionally also for users (/me).
  • More placeholders for the internal and external message (e.g. own name)
  • Read the ID of the appointment to check if it was deleted and then delete the auto-reply.

A few more words: We developed the app because I regularly forget to set my OoF notifications. So it was in my own interest to automate this. Yay finally I never forget again. It's my first program, so the code is definitely not ideal yet. But I tried to comment everything so far.

I worked with my colleague, he has a bit more experience like me and helped me a lot.

Thanks for the cool event, we could learn a lot from it and it will definitely not be the last app.

Have fun with the app!

Creators 🚀

SomebodyToLove1337 maxhe87

Repo URL

https://github.com/SomebodyToLove1337/hackTheCalendar

Team members

SomebodyToLove1337, maxhe87

SomebodyToLove1337 avatar Mar 15 '23 10:03 SomebodyToLove1337