Location: PHPKode > projects > Maintainable PHP Framework > app/models/Notifier.php
<?php

class Notifier extends Mad_Mailer_Base
{
    /**
     * This test message uses strings for all email lists
     * 
     * @param   User    $user
     */
    public function confirm($user)
    {
        $this->subject      = "Confirmation for $user->first_name";
        $this->body['user'] = $user;
        $this->body['url']  = 'http://maintainable.com';

        $this->recipients   = 'hide@address.com';
        $this->from         = 'hide@address.com';
        $this->cc           = 'hide@address.com';

        $this->sentOn       = time();
        $this->headers      = array();
    }

    /**
     * @param   User    $user
     */
    public function send($user)
    {
        $this->subject      = "Confirmation for $user->first_name";
        $this->body['user'] = $user;
        $this->body['url']  = 'http://maintainable.com';

        $this->recipients   = array('hide@address.com', 'Mike Naberezny <hide@address.com>');
        $this->from         = 'hide@address.com';
        $this->cc           = array('hide@address.com', 'hide@address.com');
        $this->bcc          = array('hide@address.com', 'hide@address.com');

        $this->sentOn       = strtotime("-30 days");
        $this->headers      = array('Organization' => 'Maintainable, LLC');
    }
    
    public function sendWithAttachments() 
    {
        $this->subject      = "Confirmation for test";
        $this->body['url']  = 'http://maintainable.com';

        $this->recipients   = 'hide@address.com';
        $this->from         = 'hide@address.com';

        $this->attachment(array('contentType' => 'text/plain',
                                'body'        => 'the attachment',
                                'filename'    => 'check_it_out.txt'));
    }

    public function sendWithUniqueAttachmentNames($user) 
    {
        $this->subject      = "Confirmation for $user->name";
        $this->body['user'] = $user;
        $this->body['url']  = 'http://maintainable.com';

        $this->recipients   = 'hide@address.com';
        $this->from         = 'hide@address.com';

        $this->attachment(array('contentType' => 'text/plain',
                                'body'        => 'the attachment',
                                'filename'    => 'check_it_out.txt'));

        $this->attachment(array('contentType' => 'text/plain',
                                'body'        => 'another attachment',
                                'filename'    => 'check_it_out.txt'));

        $this->attachment(array('contentType' => 'text/plain',
                                'body'        => 'the attachment',
                                'filename'    => 'check_it_out.txt'));
    }
}
Return current item: Maintainable PHP Framework