Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Interacts with Queue on Mail #18065

Closed
stefensuhat opened this issue Feb 23, 2017 · 7 comments
Closed

[5.4] Interacts with Queue on Mail #18065

stefensuhat opened this issue Feb 23, 2017 · 7 comments

Comments

@stefensuhat
Copy link

  • Laravel Version: 5.4.13
  • PHP Version: 7.1
  • Database Driver & Version: Maria DB 10

Description:

Cannot Interacts with Queue on Mail for example: tries , timeout like on Jobs

Steps To Reproduce:

on my Mail\PasswordReset.php:

    class PasswordReset extends Mailable implements ShouldQueue
{
    use Queueable, SerializesModels, InteractsWithQueue;

    public $tries = 1;

    public $email, $token;

    /**
     * Create a new message instance.
     *
     * @param $email
     * @param $token
     */
    public function __construct($email, $token)
    {
        $this->email = $email;
        $this->token = $token;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('front.emails.auth.password-reset');
    }
}
@themsaid
Copy link
Member

Cannot

Please share more details, what's not working?

@stefensuhat
Copy link
Author

stefensuhat commented Feb 24, 2017

@themsaid public $tries = 1; function is not working. I still need to command art queue:work --tries=1.

@tomcoonen
Copy link

tomcoonen commented Feb 24, 2017

I seem to have a similiar issue, I implemented ShouldQueue but setting the queue in the constructor doesn't have any effect. The mail isn't even queued, but sent directly.
https://laravel.com/docs/5.4/mail#queueing-mail

class OrderConfirmation extends Mailable implements ShouldQueue
{
    use Queueable, SerializesModels;

    public function __construct()
    {
        $this->queue = 'email';
    }

@tomcoonen
Copy link

@themsaid I got an email notification but don't see your post here, I added some extra info to my original comment.

@themsaid
Copy link
Member

@tomcoonen I think this is something else, I just tested your scenario and it works fine please double check your email queue.

@themsaid
Copy link
Member

@ssuhat opened a PR to add this feature: #18103

Thanks

@tomcoonen
Copy link

@themsaid found it: #18147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants