PDA

View Full Version : Logging emailed articles


menscerto
04-12-2008, 01:11 PM
Does the system log the info (email,comments) of article email-to's?

If not - is this do-able?

Micha
04-12-2008, 03:45 PM
I'm not sure I understand you :confused:

Could you please explain a little bit more on what you mean?

menscerto
04-13-2008, 03:22 AM
On my old system, if someone chose "send this article as an email to a friend" and wrote a comment with it - it would store that info (emaill address of sender and recipient and comment) in a log.

I wouldn't mind reproducing that functionality in Vivvo.

Micha
04-14-2008, 09:03 AM
Vivvo does not support this function out of the box.
This can be done as a customization.

You can customize your lib\vivvo\service\Articles.service.php starting from line 600 (email_to_a_friend function) to achieve this.

menscerto
04-14-2008, 02:20 PM
Thanks for the advice.

I made a quick mod and it works great - it simply creates a text log of "email to a friend" requests for reference.

If anyone is interested let me know and I'd be happy to post it.

GISL
04-14-2008, 02:26 PM
cool that would be great. can you post it.

menscerto
04-14-2008, 05:52 PM
Here it is - very basic.

After this line in email_to_a_friend() in articles.service.php...


if (preg_match('/^[a-zA-Z0-9_\-\/\.]+@[a-zA-Z0-9_\-\/]{2,}([\.][a-zA-Z0-9_\-\/]{2,}){1,}$/',$to)){



Add this code...


/**
* Mod to log emails sent in text file
*/

$today = date("F j Y g:i a");
$mail_log_data = $today." | ".$article_id." | ".$to." | ".$bcc." | ".$your_email." | ".$message."\n";
$fp = fopen("mail_log.txt","a"); // add file path if desired
fwrite($fp, $mail_log_data);
fclose($fp);

/**
* End Mod
*/



This gives you a basic text file with all of the email data in mail_log.txt in whatever path is indicated - nothing fancy.

If anyone wants, they can create a database log and a nice Web interface for it - and if they do, please sent it to me!

GISL
04-15-2008, 04:57 PM
thank you. Will put it to use soon.