'Disable Outlook Addin JS API

I have an use case where the addin should be enabled on specific machines instead of all the machines automatically. Does bt:Url field in manifest.xml support that ? If the Url is unreachable, mail should be allowed by default instead of being blocked (which is the default response from Outlook)enter image description here

Is there any way to do this ?



Solution 1:[1]

There are several ways to bridge the gap (solutions for your scenario):

  1. Administrators can disable the on-send policy by ensuring the user's group policy setting Block send when web add-ins can't load is set to Disabled. To manage this policy setting, you can do the following:

    1. Download the latest Administrative Templates tool.
    2. Open the Local Group Policy Editor (gpedit.msc).
    3. Navigate to User Configuration > Administrative Templates > Microsoft Outlook 2016 > Security > Trust Center.
    4. Select the Block send when web add-ins can't load setting.
    5. Open the link to edit policy setting.
    6. In the Block send when web add-ins can't load dialog window, select Enabled or Disabled as appropriate then select OK or Apply to put the update into effect.
  2. In the onSend event handler you may detect the mailbox or call an external web service which can give the answer whether to run your workload for a specific user / mailbox or not. Following that way you will be able to run your stuff for particular users only.

Read more about that in the Install Outlook add-ins that use on-send artice.

Solution 2:[2]

Would Smart Alerts (in preview) help you achieve your goal here?

Note, you can specify SendMode option in the manifest for a Smart Alert. There are three options available - PromptUser, SoftBlock and Block. With the SoftBlock option, if the add-in is unavailable (for example, there's an error loading the add-in), the item will be sent.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugene Astafiev
Solution 2