The CreatorCon Call for Content is officially open! Get started here.

Email notifications for Password Reset

Michael Bachme1
Kilo Guru

We have implemented Password Reset. Part of the process is to ensure users have entered a secondary email address (custom field) in their profiles. I'm looking to create an email notification that will be sent when:

Password Reset Enrollment Snapshot Status is "Active"

Secondary email is not empty

I initially pointed the notification to the pwd_enrollment_snapshot table and had it run on Update. However, I realized that won't work given that the user's are updating their profiles on the sys_user table.

This "Enrollment Complete" notification should check the user's enrollment status when they add a secondary email address in their profile. How do I do this?

Thanks in advance!

Michael

1 ACCEPTED SOLUTION

This helps. While I was testing this, it helped me come up with a different solution by simply placing an Info message under the Secondary email field only if it is empty.



With an onLoad Client Script on the sys_user table:



function onLoad() {


  //Type appropriate comment here, and begin script below


  var se = g_form.getValue('u_email');


  if (se == ''){


  g_form.showFieldMsg('u_email', 'ADD YOUR MESSAGE HERE', 'info'); //display info message if secondary email field is empty


  } else {


  g_form.hideFieldMsg('u_email', 'ADD YOUR MESSAGE HERE', 'info'); //hide info message if secondary email is specified


  }


}


View solution in original post

7 REPLIES 7

ah, much simpler then.


function checkEnrollment() {



  var user = g_form.getUniqueValue();


  var enrol = new GlideRecord('u_pwd_enrollment_snapshot');


  enrol.addQuery('u_user', user); //u_user is the user field on the enrollment table


  enrol.addQuery('u_enrollment_status', 'true'); //enrollment status is active


  enrol.query();



  while(enrol.next()) {


  alert('success.');


  }


}



In this configuration, enrollment status is a true/false field, but you can change it to suit your needs,,,


Harel


This helps. While I was testing this, it helped me come up with a different solution by simply placing an Info message under the Secondary email field only if it is empty.



With an onLoad Client Script on the sys_user table:



function onLoad() {


  //Type appropriate comment here, and begin script below


  var se = g_form.getValue('u_email');


  if (se == ''){


  g_form.showFieldMsg('u_email', 'ADD YOUR MESSAGE HERE', 'info'); //display info message if secondary email field is empty


  } else {


  g_form.hideFieldMsg('u_email', 'ADD YOUR MESSAGE HERE', 'info'); //hide info message if secondary email is specified


  }


}


Very good. If you can share your code for other people to use - that'd be great.


Also, mark your answer has correct, so that other people can find and use it.