Rifad Posted April 8, 2019 Share Posted April 8, 2019 Hello, I would like to know if there is any way for the welcome email not to be logged in the Email sections in the client area (just like reset password link. the new password mail will not show in the email logs). The passwords are saved in encrypted format with reverse encryption disabled. Also, we don't want to see the client area password. In the welcome mail, it is showing. So we disabled it. But we want our customers to receive the username and password once the account is created. Any help is highly appreciated 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 8, 2019 Share Posted April 8, 2019 8 hours ago, Rifad said: I would like to know if there is any way for the welcome email not to be logged in the Email sections in the client area (just like reset password link. you can prevent an email from being logged by using an action hook... <?php /** * Prevent Specific Emails Being Logged Hook * @author brian! */ function prevent_specific_email_subjects_being_logged($vars) { $invalidsubjects = array('Welcome'); $return = []; if (in_array($vars['subject'],$invalidsubjects)) { $return['abortLogging'] = true; } return $return; } add_hook("EmailPreLog", 1, "prevent_specific_email_subjects_being_logged"); in the above hook, i've created an array of Subject titles that you want to block, e.g 'Welcome' (the client signup email) - this can be a comma separated list of subject titles that you want to block from logging.... I thought using an array would be more efficient if you end up wanting to block multiple emails, and/or emails with different subject languages etc. obviously this hook only applies to emails sent after the installation of the hook, not the ones sent previously - additionally, you could run a ClientAreaPageEmails action hook to block emails with specific subjects from being viewed... that would prevent previous welcome emails from being viewed by the client... though I get the impression that your concern is more about security rather than preventing the client from seeing the password in the emails. 🔐 the email log is stored within the tblemails database table, so removing them from there manually, or with a SQL query would be another option for removing past emails. 1 Quote Link to comment Share on other sites More sharing options...
Rifad Posted April 9, 2019 Author Share Posted April 9, 2019 8 hours ago, brian! said: you can prevent an email from being logged by using an action hook... <?php /** * Prevent Specific Emails Being Logged Hook * @author brian! */ function prevent_specific_email_subjects_being_logged($vars) { $invalidsubjects = array('Welcome'); $return = []; if (in_array($vars['subject'],$invalidsubjects)) { $return['abortLogging'] = true; } return $return; } add_hook("EmailPreLog", 1, "prevent_specific_email_subjects_being_logged"); in the above hook, i've created an array of Subject titles that you want to block, e.g 'Welcome' (the client signup email) - this can be a comma separated list of subject titles that you want to block from logging.... I thought using an array would be more efficient if you end up wanting to block multiple emails, and/or emails with different subject languages etc. obviously this hook only applies to emails sent after the installation of the hook, not the ones sent previously - additionally, you could run a ClientAreaPageEmails action hook to block emails with specific subjects from being viewed... that would prevent previous welcome emails from being viewed by the client... though I get the impression that your concern is more about security rather than preventing the client from seeing the password in the emails. 🔐 the email log is stored within the tblemails database table, so removing them from there manually, or with a SQL query would be another option for removing past emails. Thank you @brian! . I will try this and get back to you at the earliest. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.