Scroll to navigation

Sympa::Message::Template(3Sympa) sympa 6.2.72 Sympa::Message::Template(3Sympa)

NAME

Sympa::Message::Template - Mail message generated from template

SYNOPSIS

  use Sympa::Message::Template;
  my $message = Sympa::Message::Template->new(
      context => $list, template => "name", rcpt => [$email], data => {});

DESCRIPTION

Methods

Constructor. Creates Sympa::Message object from template.

Parameters:

Content: Sympa::List, robot or '*'.
Template filename (without extension).
Scalar or arrayref: SMTP "RCPT TO:" field.

If it is a scalar, tries to retrieve information of the user (See also Sympa::User.

Hashref used to parse template, with keys:
SMTP "MAIL FROM:" field if sent by SMTP (see Sympa::Mailer), "Return-Path:" field if sent by spool.

Note: This parameter was OBSOLETED. Currently, {envelope_sender} attribute of object is taken from the context.

"To:" header field
Language tag used for parsing template. See also Sympa::Language.
"From:" field if not a full msg

Note: This parameter was OBSOLETED. The "From:" field will be filled in by "sympa" address if it is not found.

"Subject:" field if not a full msg
"Reply-To:" field if not a full msg
Body message if $filename is ''.

Note: This feature has been deprecated.

Additional headers, hashref with keys are field names.

Below are optional parameters.

Delivery time of message. By default current time will be used.
Forces setting envelope sender. '<>' may be used for null envelope sender.
Forces setting priority if specified.
Forces tracking if specified.

Returns:

New Sympa::Message instance, or "undef" if something went wrong.

SEE ALSO

Sympa::Message, Sympa::Template.

HISTORY

"new_from_template" in Sympa::Message appeared on Sympa 6.2.

It was renamed to "new" in Sympa::Message::Template on Sympa 6.2.13.

2024-07-15 6.2.72