it simple quesion php or might symfony2.
i using swift_message sending emails.
i send 2 emails show twig file.
however sending emails take time.
consequently,user has wait long time see html page.
could send emails , show html @ same time?
$messaggio = \swift_message::newinstance() ->setsubject('confirm') ->setcontenttype("text/html") ->setfrom('email@gmail.com') ->setto($this->user->getemail()) ->setbody($this->renderview('acmememberbundle:default:customer.txt.twig'); // $messaggio = \swift_message::newinstance() ->setsubject('confirm email') ->setcontenttype("text/html") ->setfrom('email@gmail.com') ->setto($this->user->getemail()) ->setbody($this->renderview('acmememberbundle:default:staff.txt.twig'); // return $this->render('acmememberbundle:default:form.html.twig');
thank in advance
i'm guessing use mailer service send emails? if not, have to.
this->get('mailer')->send($messaggio);
to send emails not can configure spool. 2 spools supported. memory spool, holds messages in memory , sends them after kernel has terminated, means got rendered , sent client. or file spool. it, messages got saved file, , have issue console command cronjob periodically send mails.
Comments
Post a Comment