We are using Knack email capability to send email notifications to staff when certain create and edit forms are submitted. Email addresses are selected from connected record fields, for example “store manager” or “regional manager”. All stock standard Knack functionality.
My question is this: has anyone devised a way to allow users to opt out of receiving such emails? For example, one of the regional managers might not want to be notified about Knack record updates. More correctly stated, is there any way to conditionally add (or not add) addressees to Knack emails based on some user attribute?
Could you accomplish this by adding a field to your accounts table, named something like ‘recieve emails’, default this to true. Then add an additional email field that has a validation rule, like if ‘recieve emails’ is true, then set to the main email field, else leave it blank. Then change your email to be sent to the new email field as opposed to the other. That way the email is only there if the ‘recieve emails’ field is true. You could then include the ‘receive emails’ field in their account settings page, and maybe include a link in the email footer that takes them to their account settings page.
I have not tried this exactly, but think it should work for what you need?
Good thought, and technically could work, but I think its likely to be quite messy to implement in practice. I’ll give it a try and see what I can come up with.
My concern:
I’m referencing a ROLE in the email addressing. The roles only inherit 5 default fields from the parent Accounts table - not any additional fields that I may have defined. So that second conditional email field that I add into the parent Accounts record for the user isn’t available as an attribute of any specific roles that user may have. And as my users take on multiple roles, I would need to replicate that new second conditional email field into all the roles that can receive emails, and then I would need to toggle its value to either the primary email address or blank across all those roles. Not un-doable, but not elegant.