Add mail style template override.

This commit is contained in:
Martin Kamerbeek 2010-05-06 13:51:51 +02:00
parent bcaa3f87b3
commit 63798b98f1

View file

@ -25,6 +25,12 @@ sub definition {
my $i18n = WebGUI::International->new( $session,'AssetAspect_Mailable' ); my $i18n = WebGUI::International->new( $session,'AssetAspect_Mailable' );
tie my %properties, 'Tie::IxHash', ( tie my %properties, 'Tie::IxHash', (
mailStyleTemplateId => {
fieldType => 'template',
label => 'Mail template',
tab => 'mailable',
namespace => 'style',
},
); );
push( @{ $definition }, { push( @{ $definition }, {
@ -73,8 +79,15 @@ sub processContentAsUser {
$session->user( { userId => $userId } ); $session->user( { userId => $userId } );
$session->log->preventDebugOutput; $session->log->preventDebugOutput;
my $styleTemplateId =
$self->get('mailStyleTemplateId')
|| $self->get('styleTemplateId');
# Generate email body for this user # Generate email body for this user
my $content = $self->generateEmailContent; my $content = $session->style->process(
$self->generateEmailContent,
$styleTemplateId,
);
# Process macros # Process macros
WebGUI::Macro::process( $session, \$content ); WebGUI::Macro::process( $session, \$content );