| 1 | # $Id: UnSubscribe.pm 1243 2003-07-21 16:50:06Z richardc $ | ||||||||||
| 2 | package Siesta::Plugin::UnSubscribe; | ||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 5 | ▶ | use Siesta::Plugin; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use base 'Siesta::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | sub description { | ||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 8 | 1 | 'A system plugin used for unsubscribing a member to the list'; | |||||||||
| 9 | } | ||||||||||
| 10 | |||||||||||
| 11 | 3 | ▶ | sub process { | ||||||||
|
Subroutine
process: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 12 | 3 | my $self = shift; | |||||||||
| 13 | 3 | my $mail = shift; | |||||||||
| 14 | 3 | my $list = $self->list; | |||||||||
| 15 | |||||||||||
| 16 | 3 | my $email = $mail->from; | |||||||||
| 17 | 3 | ▶ | if ( $list->remove_member($email) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 2 | $mail->reply( | |||||||||
| 19 | from => $list->address( 'admin' ), | ||||||||||
| 20 | to => $list->owner->email, | ||||||||||
| 21 | body => "$email LEFT " . $list->name | ||||||||||
| 22 | ); | ||||||||||
| 23 | |||||||||||
| 24 | 2 | $mail->reply( | |||||||||
| 25 | from => $list->address( 'unsubscribe' ), | ||||||||||
| 26 | body => Siesta->bake('unsubscribe_success', | ||||||||||
| 27 | list => $list, | ||||||||||
| 28 | message => $mail ) ); | ||||||||||
| 29 | } | ||||||||||
| 30 | else { | ||||||||||
| 31 | 1 | $mail->reply( | |||||||||
| 32 | to => $list->owner->email, | ||||||||||
| 33 | from => $list->address( 'admin' ), | ||||||||||
| 34 | body => "$email FAIL LEFT " . $list->name | ||||||||||
| 35 | ); | ||||||||||
| 36 | |||||||||||
| 37 | 1 | $mail->reply( | |||||||||
| 38 | from => $list->address( 'admin' ), | ||||||||||
| 39 | body => Siesta->bake('unsubscribe_failure', | ||||||||||
| 40 | list => $list, | ||||||||||
| 41 | message => $mail ) ); | ||||||||||
| 42 | } | ||||||||||
| 43 | 3 | return 1; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 5 | 1; | |||||||||