How to spool emails (in a task) and send normal emails in the moment in the other controllers?

php, swiftmailer, symfony

Solution

I found the solution and posted here: How to define an additional mailer service to use the spool and send instant emails in Symfony2

In a nutshell:

instant_mailer:
    class: %swiftmailer.class%
    arguments: ["@?swiftmailer.transport.real"]

Problem

In my application we send notification emails at the moment, for example, when your registry, or when need to confirm some information via email. But also we need to send personalized emails (only differenced in one text) for a hundreds of users, but I do not know how to combine Symfony2 spool email with no spool email in the same project. There are something like a parameter when sending the email to indicate this? Something like $email->send('no-spool');

Original source

Related problems