Sending Emails Using Push Queues With Confide

Using push queues to send emails offers significant benefits to your application. It boosts application performance which in turn improves the user experience which in one way or another generally leads to a more successful application.

Confide, being built specifically for Laravel 4, has its own mail method that handles translation among other things. This mail method is used for common user account emails such as account confirmation, password resets, etc. With that in mind, to use push queues with with Confide you will need to override the sendEmail() method.

To override the Confide sendEmail() method open up User.php that you created (or edited) when installing Confide and add the following code.

After saving this file, your application will now use a push queue to send user account emails.

This entry was posted in Uncategorized. Bookmark the permalink.

3 thoughts on “Sending Emails Using Push Queues With Confide

  1. Since you already using 3rd party service to manage queue, why not use API to send email? I know it is a bit off topic, but it will provide solution for entire application, not just auth part.

    Mailgun, Mandrill and others offer API and I’m pretty sure they will queue your emails (Mandrill will for sure) without using Job queue credits.

    • Mikhail,

      Using a third party service provider for email is definitely a great solution. Personally, I use Mandrill in most of my projects. That being said, I find many implementations of mandrill tend to use SMTP and not the Mandrill API directly. Though, thats another discussion for another time. If an application is sending its email via SMTP (regardless of the service provider) it will take much longer to process that request without using a job queue compared to using a job queue.

      In a recent application I have worked on I saw a 600% increase in application performance when using job queues to deliver email. That same application uses Mandrill for its mail delivery service but did so via SMTP. For these reasons I chose to write this post specifically about using push queues with the Confide package and avoided email service providers all together.

      Thank you for replying. I hope when others read our comments they strongly consider using Mandrill (or any other provider) via the API as their are obvious benefits when it comes to speed. That said, push queues have many uses in an application and mail delivery is certainly a valid one.

      • Agree. I guess SMTP is kind of default provider, therefore most people will use it and most frameworks will cater to that need.

        Thanks for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *