Mailing Framework (since build 1595)

Skip to end of metadata
Go to start of metadata

General information

The “Pimcore Mailing Framework” provides an easy way to send/create emails with Pimcore.  

Therefore you have several components:

Pimcore provides a "Pimcore_Mail" Class which extends the "Zend_Mail" Class. When you initialize a Pimcore_Mail object, all data from "Settings" -> "System" -> "Email Settings" are applied automatically.  

When you enable the debug mode in Settings" -> "System" -> "Debug", all emails will be sent to the addresses given in "Settings" -> "System" -> "Email Settings" -> "Debug Email Addresses" and the debug information (to whom the email would have been sent) is automatically appended.
Pimcore provides a "Document Email" type where you can define the reciptients... (more information here) and "Dynamic Placeholders" (more information here)

To send a email you just create a "Email Document" in the Pimcore admin, define the subject, recipients, add Dynamic Placeholders... and pass this document to the Pimcore_Mail object. All nasty stuff (creating valid urls, emedding css, compile less files, rendering the document..) ist automatically handled by the Pimcore_Mail Object.

Usage example

*Lets assume that we have created a "Email Document" in the Pimcore admin (/email/myemaildocument) which looks like this:

To send this document as email we just have to write the following code-snippet in our ControllerAction:

        //dynamic parameters
        $params = array('firstName' => 'Pim',
                        'lastName' => 'Core',
                        'product' => 73613);

        //sending the email
        $mail = new Pimcore_Mail();
        $mail->addTo('example@pimcore.org');
        $mail->setDocument('/email/myemaildocument');
        $mail->setParams($params);
        $mail->send();
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.