How can i go specific user email inbox or google calendar and all other google application

Here is my code.

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>repl.it</title>
  <link href="style.css" rel="stylesheet" type="text/css" />
 </head>
 <body>
   <script src="script.js"></script>
   <a href="https://mail.google.com" target="_blank">go email</a>
   <br><br>
   <a href="https://calendar.google.com/" target="_blank">go calendar</a>
 </body>
</html>

enter image description here

But when I click both link server is redirect me on default email inbox and google calendar (that is set in my browser). And i have multiple user login in my chrome browser.So i want to go specific user email address.

My question is that how can i go particular user email or calendar.

Thanks in advance.

1 answer

  • answered 2021-06-10 13:30 Sven Eberth

    When you change your account, you can see that google changes a part in the url as well.

    For example:

    https://calendar.google.com/calendar/u/0/r
    

    changes to

    https://calendar.google.com/calendar/u/1/r
    

    The ID (0, 1) seems to be the order in which you logged in.

    I tried what happens when you replace this ID by an email. And it seems to work.

    https://calendar.google.com/calendar/u/me@gmail.com
    

    opens the calander for the user me@gmail.com.

    Note: I didn't find any official docs etc. describing this. So maybe this will work for you or not. Of course google can change this whenever at any time. I would not rely on it and would not use it in production.