Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Safe Links, Add option for default reminder #172

Open
tjuwin1 opened this issue Dec 5, 2020 · 1 comment
Open

Convert Safe Links, Add option for default reminder #172

tjuwin1 opened this issue Dec 5, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@tjuwin1
Copy link

tjuwin1 commented Dec 5, 2020

  1. When meeting invites are forwarded from Outlook, hyperlinks (for Teams/Webex meetings) are masked by adding safelinks.protection.outlook.com prefix on them and forces the links to be opened via certain apps only.

E.g:
\nLearn More<https://aka.ms/JoinTeamsMeeting> | Meeting options<https://ap c01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fteams.microsoft.co m%2FmeetingOptions%2F%3ForganizerId%3D86e02103-9c5b-4e5f-9

I used this additional function to replace safelinks server name with google.com

function updateSafelinks(linkData){
var matcherUrl = new RegExp('https:\/\/.*?safelinks.protection.outlook.com\\/.*?\\\?url=','g');
linkData = linkData.replace(matcherUrl,"https://www.google.com/url?q=");
return linkData;
}

This is called from createEvent

if (descriptionAsTitles && event.hasProperty('description'))
var eventSummary = updateSafelinks(icalEvent.description);
else if (event.hasProperty('summary'))
eventSummary = updateSafelinks(icalEvent.summary);

  1. When sharing calendar from Outlook (https://docs.microsoft.com/en-us/outlook/troubleshoot/calendaring/how-to-share-calendar-and-contacts#what-do-you-want-to-share), it removes all reminders from all meetings. Hence, I added a 5min default reminder to all my events by having this logic in createEvent:

if (valarms.length > 0){
....
}else{
var overrides = [];
overrides.push({'method' : 'popup', 'minutes' : 5});
newEvent.reminders = {
'useDefault' : false,
'overrides' : overrides
};
}

Please add these enhancements to the original scripts, if found useful.

@tjuwin1 tjuwin1 added the enhancement New feature or request label Dec 5, 2020
@derekantrican
Copy link
Owner

  1. Why are you appending "https://www.google.com/url?q=" to the safelink? Can't you just take out the "safelinks..." prefix, then decode the rest of the url? I would suggest something like:
function updateSafelinks(linkData){
  var matcherUrl = new RegExp('https:\/\/.*?safelinks.protection.outlook.com\\/.*?\\\?url=','g');
  linkData = decodeURIComponent(linkData.replace(matcherUrl,""));
  return linkData;
}

Otherwise, it seems like an acceptable add to the script. Make this change and start a PR - I'll take a look at it.

  1. The link you provided doesn't seem to clearly say "all reminders are removed from meetings when sharing from Outlook" (and a quick Google search doesn't show me anything to that effect - so it at least isn't well known). But, regardless, I think this is a change to be made on a user-by-user basis and not to put into the main script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants