Grab a copy of the project or browse the repository.
Painless HTML Emails with Zend_Mail
Description
Quickly and easy it is to write designer-friendly HTML emails using Zend_View and Zend_Mail
Tags
email, HTML / CSS, templates, zend_mail
Grab a copy of the project or browse the repository.
Quickly and easy it is to write designer-friendly HTML emails using Zend_View and Zend_Mail
email, HTML / CSS, templates, zend_mail
Thank you for this great Screen cast. This is very helpful.
Hey Jon.. im glad for back to your blog ! Nice post…
But i have a point to observe in your application.ini
autoloaderNamespaces[] = “ZC”
i’m using underscore at end.. i saw in others blogs… many tutorials
Whats the correct mode ?
thanks..
Once again, Jon, great screencast. I just finished up my logic for registration, password reset and this will definitely help to spruce up those emails a bit.
I have question, i try use $this->baseUrl(); helper in template and doesn’t work. Any help?
Very nice screencast, as everytime!
Just for the record: The autocompletion in your IndexController is not working because phpDoc says addTo() returns Zend_Mail object, and sendHtmlTemplate() is in your ZC_HtmlMailer class, not in Zend_Mail.
The same applies when you want to create setViewParam() function.
@PHPGangsta,
Thanks for mentioning this!
@Vitor,
I think both will work.
Hi Jon,
Nice to see someone else take this approach to html emails. I actually wrote something similar back in early december for my own project, and wrote up a quick post about it at http://www.tkstudios.com/2009/12/02/zend-framework-email-templating-with-layouts-views/
It includes the ability to send emails with both HTML and text versions of a template.
Any chance you’ll be messing around with Zend_Markup sometime soon?
@Ladislav
Not sure why that’s not working, but as an alternative, you can use the url helper to create links in your template:
$this->url(array(‘controller’ => ‘mycontroller’, ‘action’ => ‘myaction’));
Interesting, thank you.
Hey,
Anyone knows how to change the production environment, I just installed ZF and got the basic app running, but when i try to edit some stuff it throws me white pages, if i print the APPLICATION_ENV constant i get “production”, how can i change this to development?
Thanks,
Great tuts Jon.
Normally you do this in your httpd.conf (or your vhost.conf) or your .htaccess:
SetEnv APPLICATION_ENV development
@PHPGangsta
U can change this var in several places..
.htaccess
SetEnv APPLICATION_ENV development
index.php
// In the firsts lines.. add this
define(‘APPLICATION_ENV’, ‘development’)
// if u are using apache + virtual hosts
httpd-vhosts.conf
// add this to directory section
SetEnv APPLICATION_ENV development
…
@PHPGangsta
sorry i saw your name and make a mistake with who make the question ehehe..
by the way.. i complete your answer
Hi,
As usual excellent tutorial
Just only a point I ended up passing the
view instance through the constructor
in this way
__construct(Zend_View $view,$charset = ‘UTF-8′)
because of I got an error layout.phtml not found
(I have the layouts in layouts folder
; Layout
resources.layout.layoutpath = APPLICATION_PATH “/layouts”
resources.layout.layout = default)
Bye
Another quality tutorial, thank you!
Thank you all, I’ve learned so much 
And as usually great feedback from people watching
Tip of this screencast goes to Jose Grieco
@knodumi
Hi mate! How have you managed to get it working with arrays of arrays (key=>value)? Do I need to modify any Jquery params?
Thanks!
@knodumi
Hi mate! How have you managed to get it working with arrays of arrays (key=>value)? Do I need to modify any Jquery params?
Thank you!
Thanks!
Great solution, thanks!!!
I noticed that if you use the <?php tag, in the template. The variables don't show up in the email. So you always have to use the <?= tag ??