Skip to content
Snippets Groups Projects
Unverified Commit 9f254d8a authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #2539 from nextcloud/mailto_button

Add mailto: protocol handler
parents d7c1cdf9 9bccbf4b
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,11 @@
/>
<label for="gravatar-enabled">{{ t('mail', 'Use Gravatar and favicon avatars') }}</label>
</p>
<p>
<button class="icon-mail app-settings-button" @click="registerProtocolHandler">
{{ t('mail', 'Register as application for mail links') }}
</button>
</p>
<p class="icon-details app-settings-button button">
<router-link :to="{name: 'keyboardShortcuts'}">
{{ t('mail', 'Keyboard shortcuts') }}
......@@ -35,6 +39,7 @@
<script>
import Logger from '../logger'
import {generateUrl} from '@nextcloud/router'
export default {
name: 'AppSettingsMenu',
......@@ -62,6 +67,17 @@ export default {
this.loadingAvatarSettings = false
})
},
registerProtocolHandler: function() {
if (window.navigator.registerProtocolHandler) {
var url =
window.location.protocol + '//' + window.location.host + generateUrl('apps/mail/compose?uri=%s')
try {
window.navigator.registerProtocolHandler('mailto', url, OC.theme.name + ' Mail')
} catch (err) {
Logger.error('could not register protocol handler', {err})
}
}
},
},
}
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment