Jump to content

Email Logging


Rifad

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated