How to prevent user from turning off primary email channel?

lss123
Tera Contributor

I have a requirement to prevent users from turning off their primary email channel.  We've tested that if they do so, they will not get mandatory notifications.  Even if 'Force Delivery" is checked on the notification configuration, turning off the notification channel from the system settings will prevent the email from going out.  Is there any way to do this?

I've included a screenshot for clarity.  What we'd want to do is make the switch for primary_email be read-only, or otherwise prevent them from toggling it off.  I have tried a business rule on the cmn_notif_device table, and that does force the channel to stay active, however the user can still toggle the switch off (thereby misleading the user into thinking it's off when it's really on).

 

find_real_file.png

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

Got it.  Do a similar business rule on the cmn_notif_device table.  The conditions will looks like this.

 find_real_file.png

 

On the actions tab just choose abort action checkbox as it will not display the message.  note it will look like it still allowed them to disable it but if you go back into the notification you will see it is back to green.

View solution in original post

11 REPLIES 11

Thank you for the suggestion. I think that will do it. 

It is not pretty but will do the job. 

The users won't like it since it will confuse them like you said.


If I helped you with your case, please click the Thumb Icon and mark as Correct.


Its strange that the original one I gave for the sys_user table does revert all notification back on the screen so they are not getting confirmation.  Maybe you will just need to play around with the Order the business rule runs.

p_espinar
Kilo Guru

I think that the easiest way to accomplish that is to set the property "glide.notification.preference.ui.enabled" to false.

Un saludo,
Pablo Espinar
Consultant at Econocom Spain

Please mark this response correct if I've answered your question. Thanks!

Eric Medina
Tera Contributor

I was recently troubleshooting your original issue of mandatory/forced delivery notifications not sending when the email channel is disabled. I was actually able to solve this without forcing users to keep the email channel on. If you add the recipient via a mail script instead, that will bypass the channel settings of the user. For example, I created a mail script named "bypass parm 1 notification settings" with the following content:

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {

          email.addRecipient(event.parm1);

})(current, template, email, email_action, event);

then you can simply invoke that mail script with 

${mail_script:bypass parm 1 notification settings}

in your notification body. If you then send the notification and check the mail logs, you'll see it sent there.

Jon23
Mega Sage

Modifying the OOB 'cmn_notif_device' write acl to include the condition 'Primary email is false' stops the Primary Email button from being toggled:

find_real_file.png