s-ichikawa/laravel-sendgrid-driver

Message id

basvandertogt opened this issue · 5 comments

How can i retrieve the message id from Sendgrid after the mail is sent?

The send function does not generally return the result value and you can not receive the message id.
But you can do it by the little hack. as following:

  1. Create a class extends Swift_Events_SendListener, and implement the sendPerformed function to get the message id.
    https://github.com/s-ichikawa/laravel58/blob/master/app/Console/Commands/Mail/ApiSimple.php#L76-L95
  2. Get SwiftMailer from Mailer and register the class created above and re-set SwiftMailer to Mailer.
    https://github.com/s-ichikawa/laravel58/blob/master/app/Console/Commands/Mail/ApiSimple.php#L49-L51

Sorry, it could be more simple:
s-ichikawa/laravel58@fdc0dbb

@basvandertogt Did you resolve the issue?

Please re-open the issue if you have a problem yet.