Hello everybody
I added a custom button on the header of the header of Admin-Add/edit user and I would like send a password reminder to all users in the table users, the only code that I need is how to send it using the remind.php
I found that passing the email address as a parameter to remind.php will show me the page remind.php and the email address and this is my code.
arrayWithAllUsersEmails.forEach(sendPasswordReminderToEveryUser)
//
function sendPasswordReminderToEveryUser(userEmail, index, arr) {
urlToOpen="remind.php?username_email="+userEmail;
window.open(urlToOpen); //<---- HERE WILL FAIL BECAUSE OPEN THE remind.php for every user
}
and this is the code that I use in a custom button per user, and goes in the OnAfter and works
var win = Runner.displayPopup( {
url: "remind.php?username_email="+result['email'],
footer: '<a class="myCloseButton" href="#" onclick="window.win.close();return false;">'+Runner.getCustomLabel('CloseThisWindow')+'</a>',
afterCreate: function(win) {
window.win = win;
$('iframe').contents().find('html body.function-remind form#form1 div.r-panel-page div.bs-pagepanel.panel.panel-primary div.panel-heading').remove();
$('iframe').contents().find('html body.function-remind form#form1 div.r-panel-page div.bs-pagepanel.panel.panel-primary div.panel-body div#form_footer_1.r-form div.row div.col-md-6 span a.btn.btn-default').remove();
$('iframe').contents().find('html body.function-remind form#form1 div.r-panel-page div.bs-pagepanel.panel.panel-primary div.panel-body div#form_footer_1.r-form div.row div.col-md-6 span a.btn.btn-primary').click();
}
});
The inconvenience with the above code is that shows a popup and stays open, to let the admin know that the email was send it to the user.
Somebody have a how to or clue?
will be nice to include this function in the Security API, like
RemindPasswordPage::sendRemindEmail($email)