Adding basic per instance mailing configuration.

This commit is contained in:
Martin Kamerbeek 2010-05-19 17:06:18 +02:00
parent f8cb8cd05a
commit 04f39ebc19
5 changed files with 104 additions and 8 deletions

View file

@ -60,7 +60,7 @@ sub www_createMailing {
active => 0,
} );
return $self->www_view;
return $mailing->www_edit;
}
sub www_settings {
@ -124,6 +124,8 @@ sub www_view {
status => $mailing->getStatusLine,
sendTestUrl => $url->page('newsletter=mailing;func=sendTestEmails;id='.$mailing->getId),
sendUrl => $url->page('newsletter=mailing;func=sendBatch;id='.$mailing->getId),
editUrl => $url->page('newsletter=mailing;func=edit;id='.$mailing->getId),
deleteUrl => $url->page('newsletter=mailing;func=delete;id='.$mailing->getId),
};
};

View file

@ -150,8 +150,9 @@ sub send {
#### TODO: Error checking
my $mailing = $self->getMailing;
my $configuration = $mailing->get('configuration') || {};
my $asset = $mailing->getAsset;
my $content = $asset->processContentAsUser( $mailing->get('issueId'), $self->get('userId') );
my $content = $asset->processContentAsUser( $mailing->get('issueId'), $self->get('userId'), $configuration );
my $body = $self->absolutifyURIs( $content, $asset->getUrl );
# Mail is a test mail but there is noone to send the result to
@ -169,7 +170,7 @@ sub send {
}
# Fetch subject
my $subject = '[TEST] Subject selection still needs to be implemented.';
my $subject = $asset->getSubject( $configuration );
my $messageId = $id->toHex( $self->getId );
my $domain = $session->setting->get( 'newsletterReturnDomain' );
@ -187,7 +188,6 @@ sub send {
# And send it.
my $success = $mail->send;
$session->log->warn( "Sending email to [$to]" );
if ( $success ne '1' ) {
$self->error( "Mail couldn't be sent by WebGUI::Mail::Send" );
}