Closed burmkiller closed 5 years ago
Did you write use SendGrid;
?
sample: https://github.com/s-ichikawa/laravel57/blob/master/app/Mail/ApiSimpleMailable.php#L13
Yes, I've called the class and I'm still getting this
Call to undefined method App\Mail\SendTwenty::sendgrid()
hum...
write use Sichikawa\LaravelSendgridDriver\SendGrid;
too?
sample: https://github.com/s-ichikawa/laravel57/blob/master/app/Mail/ApiSimpleMailable.php#L9
I've tried both of them yet it's still giving me the same error, I'm using this in my mailable class, it should work just fine.
What version is your laravel-sendgrid-driver?
Is there sendgrid
function in vendor/s-ichikawa/laravel-sendgrid-driver/src/SendGrid.php
?
version 2 I guess, I've followed your documentation. And yes there a sendgrid function, here it is:
public function sendgrid($params) { if ($this instanceof Mailable && $this->mailDriver() == "sendgrid") { $this->withSwiftMessage(function (Swift_Message $message) use ($params) { $message->embed(new \Swift_Image(static::sgEncode($params), SendgridTransport::SMTP_API_NAME)); }); } return $this; }
I tried some pattern and got the same error. that case was written use Sichikawa\LaravelSendgridDriver\SendGrid;
above class but NOT written use SendGrid;
in class.
These are required both, did you write both?
<?php
namespace App\Mail;
use Sichikawa\LaravelSendgridDriver\SendGrid; // ←
class ApiSimpleMailable extends Mailable
{
use SendGrid; // ←
I've been gettting this error
undefined method App\Mail\SendTwenty::sendgrid()
currently I'm just doing this:
public function build() { return $this->from($this->domain_data[0]->email) ->subject("Your report is ready!") ->view('emails.twentyemail') ->sendgrid(['custom_args' => ['user_id' => $this->car_data[0]->id]]); }
Now I'm not sure where I went wrong, I've followed the installation process but doesn't seem like it's working for some reason.