php - Send mailer Symfony2 -
i use symfony2. action send message , redirect page.
like this
public function myaction() { ... code ... sendmessagewithswiftmailer() .... return $this->redirect(url); }
this code work. url
takes time opened. how can first open url
page , send message? can give me idea?
you can use:
swiftmailer: spool: { type: file }
in config_prod.yml
and:
swiftmailer: spool: { type: memory }
in config.yml
.
then, in production environment, can create crontab job executes symfony2 command:
app/console swiftmailer:spool:send
this command send spooled messages.
more info @ symfony.com/doc/current/cookbook/email/spool.html
Comments
Post a Comment