Lines 311-320
If passed a string, it'll append the string to the message.
Link Here
|
311 |
# $object->append($letter_or_item) -- add a new item to a message's content |
311 |
# $object->append($letter_or_item) -- add a new item to a message's content |
312 |
sub append { |
312 |
sub append { |
313 |
my ($self, $letter_or_item, $format) = @_; |
313 |
my ($self, $letter_or_item, $format) = @_; |
314 |
my $item; |
314 |
my ( $item, $header, $footer ); |
315 |
if (ref($letter_or_item)) { |
315 |
if (ref($letter_or_item)) { |
316 |
my $letter = $letter_or_item; |
316 |
my $letter = $letter_or_item; |
317 |
my $metadata = _metadata($letter); |
317 |
my $metadata = _metadata($letter); |
|
|
318 |
$header = $metadata->{header}; |
319 |
$footer = $metadata->{footer}; |
318 |
$item = $metadata->{body}->[0]; |
320 |
$item = $metadata->{body}->[0]; |
319 |
} else { |
321 |
} else { |
320 |
$item = $letter_or_item; |
322 |
$item = $letter_or_item; |
Lines 325-330
sub append {
Link Here
|
325 |
} |
327 |
} |
326 |
my $metadata = $self->metadata; |
328 |
my $metadata = $self->metadata; |
327 |
push @{$metadata->{body}}, $item; |
329 |
push @{$metadata->{body}}, $item; |
|
|
330 |
$metadata->{header} = $header; |
331 |
$metadata->{footer} = $footer; |
328 |
$self->metadata($metadata); |
332 |
$self->metadata($metadata); |
329 |
my $new_content = $self->render_metadata($format); |
333 |
my $new_content = $self->render_metadata($format); |
330 |
return $self->content($new_content); |
334 |
return $self->content($new_content); |
331 |
- |
|
|