0

I have created the button in the gmail inbox using inboxsdk. Now i want to get a pop up by clicking on that button

2.Pop up should contain a link which navigates to my website page(xyz.com/login.php)

How can i do these using inboxsdk

Screenshot: Screenshot

Umashankar B
  • 415
  • 8
  • 21

1 Answers1

0

If you are still struggling with this, I would suggest a simple solution which is to fire a JavaScript confirm dialog see here. On confirmation you could redirect the user, using window.location.href = '<your-url>';.

Another solution would be to use InboxSDK's widgets. Example:

InboxSDK.load(2, '<InboxSDK-app-id>').then((sdk) => {
  ...
  const el = document.createElement('div');
  el.innerHTML = '<a href="<your-url>" target="_blank">Link description</a>';

  sdk.Widget.showModalView({
    title: 'Modal Title',
    el
  });
});

For more ModalOptions look here.

Notice: I set the attribute target attribute of <a> tag to "_blank". This makes sure the url opens in another browser tab.

A third, more direct (optional) solution would be to add an onClick event listener to which you attach a function that redirects the user to your url, see a code example here.

A fourth and better possible solution would be to add a DropdownView to your button's onClick function, see example code here.