Gossamer Forum
Quote Reply
Sent Mail Stats
Heya all,

I'm looking for a plugin that will log the number of outgoing (sent) emails by month. I need some usage statistics as I want to sell my footer space to sponsors. Has anyone done something like this?

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Sent Mail Stats In reply to
I recently added in a plugin hook on send (unfortunately, it won't be in until the next release) that would allow you do track statistics on send.

Here's a patch:

Code:
===================================================================
RCS file: /cvs/gossamer/gmail/admin/GMail/Compose.pm,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- gmail/admin/GMail/Compose.pm 2004/03/04 02:03:19 1.124
+++ gmail/admin/GMail/Compose.pm 2004/03/06 05:42:03 1.125
@@ -483,7 +483,7 @@
my ($self, $id) = @_;

my $cgi = $IN->get_hash;
- $self->_send($cgi) or return $self->error($GMail::Compose::error, 'WARN');
+ $PLG->dispatch('GMail::Compose::send', sub { $self->_send(@_) }, $cgi) or return $self->error($GMail::Compose::error, 'WARN');

return { message => 'SEND_SENT' }
}
@@ -518,7 +518,7 @@
$cgi->{references} = $ref if $ref and $ref ne '<>';

# Send the email
- $self->_send($cgi, 'reply') or return $self->error($GMail::Compose::error, 'WARN');
+ $PLG->dispatch('GMail::Compose::send', sub { $self->_send(@_) }, $cgi, 'reply') or return $self->error($GMail::Compose::error, 'WARN');

return { message => 'SEND_REPLY' };
}
@@ -537,7 +537,7 @@
$id or return $self->error('SENDERR_NOMID', 'WARN');
$id =~ /^\d+$/ or return $self->error('SENDERR_ID', 'WARN', $id);

- $self->_send($cgi, 'forward') or return $self->error($GMail::Compose::error, 'WARN');
+ $PLG->dispatch('GMail::Compose::send', sub { $self->_send(@_) }, $cgi, 'forward') or return $self->error($GMail::Compose::error, 'WARN');

return { message => 'SEND_FORWARD' };
}
@@ -551,7 +551,7 @@
my $self = shift;
my $cgi = $IN->get_hash;

- $self->_send($cgi, 'draft');
+ $PLG->dispatch('GMail::Compose::send', sub { $self->_send(@_) }, $cgi, 'draft');

return { message => 'DRAFT_SAVED' };
}

Adrian