Disable the send button

852 views
Skip to first unread message

Gavin

unread,
Jun 13, 2016, 1:52:22 AM6/13/16
to InboxSDK
Hey Team,

I am wondering if it is possible to disable the send button on Gmail unless a pre-defined condition is met for each email. I have been through all of your documentation and the Gmail API and cannot find reference to this. Can it be done?

Omar Ismail

unread,
Jun 13, 2016, 1:32:53 PM6/13/16
to Gavin, InboxSDK
hi Gavin, you can't actually disable the button itself, but the presending event that composeView emits that event object has a "cancel" function (https://www.inboxsdk.com/docs/#ComposeView). That cancel function makes it so that the compose doesn't actually get sent.

UX wise you definitely should not just cancel the sending, you should also show a message to the user (modal or tooltip) indicating that the send was canceled and why.


Omar

On Sun, Jun 12, 2016 at 10:52 PM, Gavin <gavin.co...@gmail.com> wrote:
Hey Team,

I am wondering if it is possible to disable the send button on Gmail unless a pre-defined condition is met for each email. I have been through all of your documentation and the Gmail API and cannot find reference to this. Can it be done?

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/da120d1f-64b5-4644-891a-c74aad6dfa0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gavin Convery

unread,
Jun 15, 2016, 12:29:06 AM6/15/16
to Omar Ismail, InboxSDK
That helps a lot. Thank you very much! I'm trying to call the presending cancel function if the subject line does not match some pre-determined regex pattern but I can't seem to call it. I know that this is very basic but any help would be greatly appreciated.

This is what I have so far:

function cancel() 
  composeView.presending(cancel);
}


function scanSub(e) {
  var regpattern = /[TEXT]/g;
  if ( composeView.getSubject() != regpattern) {
  
return cancel();
  
    }
}


--
Kind regards,

Gavin Convery
Reply all
Reply to author
Forward
0 new messages