Package DE_EPAGES::MailType::API::Object::MailType
object interface for MailType (aka e-mail events).
Base |
DE_EPAGES::Object::API::Object::Object |
Example |
#send order confirmation mail to customer my $MailType = $Order->getSite()->child('MailTypes')->child('CustomerOrderConfirmation'); # create and send mail my %MailParams = ( 'HTMLAllowed' => $Order->get('Customer')->get('IsHtmlEMailAllowed'), ); my $Email = $Order->get('BillingAddress')->get('EMail'); $MailParams{'TO'} = $Email if defined $Email; my %Vars = (); my $Container = $Order->get('LineItemContainer'); my %RegionalParams = ( Locale => $Container->get('LocaleID'), Language => GetCodeByLanguageID($Container->get('LanguageID')), ); $MailType->send( $Order, \%MailParams, \%RegionalParams, \%Vars ); |
Functions
getMail
Creates an e-mail object for the mail type.
Syntax |
$Mail = $MailType->getMail($Object, $hParams, $hRegionalParams, $hVars); |
Input |
|
Return |
|
Hook |
|
getMailParams
Appends default mail type parameters to current mail parameter.
Syntax |
$hMailParams = $MailType->getMailParams($Object, $hParams, $hRegionalParams, $hVars); |
Input |
|
Return |
|
joinMailAddress
joins the name and email to an email-address
Syntax |
$EMailAddress = $MailType->joinMailAddress($Name, $EMail); |
Example |
$EMailAddress = $MailType->joinMailAddress("Max Mustermann", "m.mustermann@epages.de"); $EMailAddress eq '"Max Mustermann" <m.mustermann@epages.de>' |
Input |
|
Return |
|
send
Sends an e-mail object using the current mail type if the MailType is active or not. The TLE placeholders in the mail templates for Content, Subject and Signature are replaced by the variables given in $hVars. Triggers the hook "MailTypeSend" before actually building the mail object and sendinf the mail. Hook functions can prevent the mail from beeing sent by setting the hook parameter "SendMail" to 0. In this case the return value will be 0.
Syntax |
$Sent = $MailType->send($Object, $hMailParams, $hRegionalParams, $hVars ); |
Example |
$MailType->send( $User, { HTMLAllowed => 1, TO => $User->get('EMail'), }, { Language => 'de', Locale => 'de_DE' }, { } ); |
Input | |
Return |
|