SMS coding complete, beginning testing.

Added getInboxAddresses method to User.pm, with tests.
All SMS/Email address choices are made in Mail/Send, on create
and on send, since that's when it handles groups.
Test variable addresses on creating mails.
Updated t/smtpd.pl to handle receiving and sending multiple messages.
This commit is contained in:
Colin Kuskie 2009-03-17 14:35:13 -07:00
parent bc3b204d9b
commit 7336d2d630
6 changed files with 174 additions and 51 deletions

View file

@ -151,16 +151,17 @@ sub create {
my $subject = (defined $properties->{emailSubject}) ? $properties->{emailSubject} : $self->{_properties}{subject};
my $mail = WebGUI::Mail::Send->create($session, {
toUser=>$self->{_properties}{userId},
toGroup=>$self->{_properties}{groupId},
subject=>$subject,
});
toUser => $self->{_properties}{userId},
toGroup => $self->{_properties}{groupId},
subject => $subject,
},
'fromInbox',
);
if (defined $mail) {
my $preface = "";
my $fromUser = WebGUI::User->new($session, $properties->{sentBy});
#Don't append prefaces to the visitor users or messages that don't specify a user (default case)
unless ($fromUser->isVisitor || $fromUser->userId eq 3) { #Can't use isAdmin because it will not send prefaces from normal users who in the admin group
my $i18n = WebGUI::International->new($session, 'Inbox_Message');
$preface = sprintf($i18n->get('from user preface'), $fromUser->username);
}
my $msg = (defined $properties->{emailMessage}) ? $properties->{emailMessage} : $self->{_properties}{message};