Send email when enabled field was checked

how can I send email automatically to customer ,when I as Admin enable their user record? I wish the function was called(my sending email function) as long as I check the field of enabledScreenshot_6

and also, when they confirm an email, I wish I received an email. How can I achieve these two goals?

I could be missing something but it sounds like you need to call a custom email function for every enabled user.

If so, could you just write your own function to read the User table and use the Email service to send emails to the Users who have True in the enabled column?

# untested code

for row in app_tables.users.search(enabled=True):
  my_email_function(row)

my question is ,how can I trigger the function right at the moment I check the field of ā€˜enabledā€™? If I have function in server module

Rather than actually selecting the checkbox in the ā€œenabledā€ column in the IDE, you could try the following:

  • make your own Admin page in your app with the Users table represented as a repeating panel or DataGrid
  • add checkboxes to correspond with the ā€œenabledā€ column in the Users table
  • set the checkbox callback function to update the ā€œenabledā€ column (or select ā€œwritebackā€ in the IDE) and call your custom email function
1 Like

great idea! I need a admin form anyway.