parents-merge 35486 - Added option for getNameForEmail() function to be added to a member, which will create in an email template sent to that person

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@45053 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2007-11-19 01:38:50 +00:00
parent cbbdd8c412
commit d8709777c0

View File

@ -61,6 +61,7 @@ class NewsletterEmailProcess extends BatchProcess {
$newsletter->Result = 'BlackListed'; $newsletter->Result = 'BlackListed';
$newsletter->ParentID = $this->newsletter->ID; $newsletter->ParentID = $this->newsletter->ID;
$newsletter->write(); $newsletter->write();
} else { } else {
$e = new Newsletter_Email($this->nlType); $e = new Newsletter_Email($this->nlType);
$e->setBody( $this->body ); $e->setBody( $this->body );
@ -68,8 +69,10 @@ class NewsletterEmailProcess extends BatchProcess {
$e->setFrom( $this->from ); $e->setFrom( $this->from );
$e->setTemplate( $this->nlType->Template ); $e->setTemplate( $this->nlType->Template );
if(method_exists($member, "getNameForEmail"))
$nameForEmail = $member->getNameForEmail();
$e->populateTemplate( array( 'Member' => $member, 'FirstName' => $member->FirstName ) ); $e->populateTemplate( array( 'Member' => $member, 'FirstName' => $member->FirstName, 'NameForEmail'=>$nameForEmail ) );
$this->sendToAddress( $e, $address, $this->messageID, $member); $this->sendToAddress( $e, $address, $this->messageID, $member);
} }
} }