| [ Index ] |
PHP Cross Reference of Akelos Framework |
[Source view] [Print]
(no description)
| Author: | Bermi Ferrer |
| Copyright: | Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org |
| License: | GNU Lesser General Public License |
| File Size: | 759 lines (28 kb) |
| Included or required: | 3 times |
| Referenced: | 0 times |
| Includes or requires: | 8 files AkActionMailer/AkMailComposer.php AkActionMailer/AkMailParser.php AkBaseModel.php AkActionView/AkPhpTemplateHandler.php AkActionView/AkHelperLoader.php AkActionMailer/AkActionMailerQuoting.php AkActionMailer/AkMailMessage.php AkActionView.php |
AkActionMailer:: (40 methods):
__construct()
loadSettings()
setTemplate()
setMailerName()
setBody()
setCc()
setBcc()
setCharset()
setContentType()
setFrom()
setHeaders()
setImplicitPartsOrder()
setMimeVersion()
setRecipients()
setSentOn()
setSubject()
addAttachment()
set()
getEncoded()
getMail()
receive()
deliverDirectly()
getRawMessage()
create()
deliver()
performSmtpDelivery()
performPhpDelivery()
performTestDelivery()
renderMessage()
render()
getTemplatePath()
initializeDefaults()
_initializeTemplateClass()
getComposer()
setComposer()
getMailerName()
getControllerName()
urlFor()
getHelpers()
_deliverUsingMailDeliveryMethod()
Class: AkActionMailer - X-Ref
AkActionMailer allows you to send email from your application using a mailer model and views.| __construct($Driver = null) X-Ref |
| No description |
| loadSettings() X-Ref |
| No description |
| setTemplate($template_name) X-Ref |
| Specify the template name to use for current message. This is the "base" template name, without the extension or directory, and may be used to have multiple mailer methods share the same template. |
| setMailerName($mailerName) X-Ref |
| Override the mailer name, which defaults to an inflected version of the mailer's class name. If you want to use a template in a non-standard location, you can use this to specify that location. |
| setBody($body) X-Ref |
| Define the body of the message. This is either an array (in which case it specifies the variables to pass to the template when it is rendered), or a string, in which case it specifies the actual text of the message. |
| setCc($cc) X-Ref |
| Specify the CC addresses for the message. |
| setBcc($bcc) X-Ref |
| Specify the BCC addresses for the message. |
| setCharset($charset) X-Ref |
| Specify the charset to use for the message. This defaults to the +default_charset+ specified for AkActionMailer. |
| setContentType($content_type) X-Ref |
| Specify the content type for the message. This defaults to <tt>text/plain</tt> in most cases, but can be automatically set in some situations. |
| setFrom($from) X-Ref |
| Specify the from address for the message. |
| setHeaders($headers) X-Ref |
| Specify additional headers to be added to the message. |
| setImplicitPartsOrder($implicit_parts_order) X-Ref |
| Specify the order in which parts should be sorted, based on content-type. This defaults to the value for the +default_implicit_parts_order+. |
| setMimeVersion($mime_version) X-Ref |
| Defaults to "1.0", but may be explicitly given if needed. |
| setRecipients($recipients) X-Ref |
| The recipient addresses for the message, either as a string (for a single address) or an array (for multiple addresses). |
| setSentOn($date) X-Ref |
| The date on which the message was sent. If not set (the default), the header will be set by the delivery agent. |
| setSubject($subject) X-Ref |
| Specify the subject of the message. |
| addAttachment() X-Ref |
| Add an attachment to the message. Example: class ApplicationMailer extends AkActionMailer { // attachments function signupNotification($Recipient) { $this->setAttributes(array( 'recipients' => $Recipient->getEmailAddressWithName(), 'from' => "system@example.com", 'subject' => "New account information" )); $this->addAttachment(array( 'content_type' => 'image/jpeg', 'body' => Ak::file_get_contents("an-image.jpg"))); $this->addAttachment('application/pdf', generate_your_pdf_here()); } } |
| set($attributes = array() X-Ref |
| Generic setter Calling $this->set(array('body'=>'Hello World', 'subject' => 'First subject')); is the same as calling $this->setBody('Hello World'); and $this->setSubject('First Subject'); This simplifies creating mail objects from datasources. If the method does not exists the parameter will be added to the body. |
| getEncoded() X-Ref |
| Gets a well formed mail in plain text |
| getMail() X-Ref |
| The mail object instance referenced by this mailer. |
| receive($raw_mail) X-Ref |
| Receives a raw email, parses it into an email object, decodes it, instantiates a new mailer, and passes the email object to the mailer object's #receive method. If you want your mailer to be able to process incoming messages, you'll need to implement a #receive method that accepts the email object as a parameter and then call the AkActionMailer::recieve method using "parent::recieve($Message);" class MyMailer extends AkActionMailer{ function receive($Message){ parent::receive($Message); ... } } |
| deliverDirectly(&$Message) X-Ref |
| Deliver the given mail object directly. This can be used to deliver a preconstructed mail object, like: $email =& $MyMailer->createSomeMail($parameters); $email->setHeader("frobnicate"); MyMailer::deliver($email); |
| getRawMessage() X-Ref |
| No description |
| create($method_name, $parameters, $content_type = '') X-Ref |
| Initialize the mailer via the given +method_name+. The body will be rendered and a new AkMailMessage object created. |
| deliver($method_name, $parameters = null, $Message = null) X-Ref |
| Delivers an AkMailMessage object. By default, it delivers the cached mail object (from the AkActionMailer::create method). If no cached mail object exists, and no alternate has been given as the parameter, this will fail. |
| performSmtpDelivery(&$Message, $settings = array() X-Ref |
| No description |
| performPhpDelivery(&$Message, $settings = array() X-Ref |
| No description |
| performTestDelivery(&$Message) X-Ref |
| No description |
| renderMessage($method_name, $body, $options = array() X-Ref |
| No description |
| render($options = array() X-Ref |
| No description |
| getTemplatePath() X-Ref |
| No description |
| initializeDefaults($method_name) X-Ref |
| Set up the default values for the various instance variables of this mailer. Subclasses may override this method to provide different defaults. |
| _initializeTemplateClass($assigns) X-Ref |
| No description |
| getComposer() X-Ref |
| No description |
| setComposer($Composer = null) X-Ref |
| No description |
| getMailerName() X-Ref |
| Alias for getModelName |
| getControllerName() X-Ref |
| Workarround for limited support of helpers on ActionMailer Views |
| urlFor() X-Ref |
| This is the url_for version for helpers and emails. As we do not have the context of a host being requested, we need to know the base_url like http://example.com in oder to add it to the generated URL |
| getHelpers() X-Ref |
| Creates an instance of each available helper and links it into into current mailer. Mailer helpers work as Controller helpers but without the Request context |
| _deliverUsingMailDeliveryMethod($method, &$Message, $options) X-Ref |
| No description |
| Generated: Mon Oct 27 12:43:49 2008 | Cross-referenced by PHPXref 0.6 |