-
Notifications
You must be signed in to change notification settings - Fork 9
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
Argument #2 ($value) must be of type string, null given #38
Comments
I'll take a look at the issue. Is it possible for you to provide the code for your Mailable class or API request payload if you're using the Facade. |
Thanks for your swift reply! Is this enough for you? $mailer->send('emails.empty', [
'msg' => $this->data['message'],
'subject' => $this->data['subject'],
'fromName' => $this->data['fromName'],
'logo' => ($this->data['logo'] ?? null) !== null ? Storage::url($this->data['logo']) : null,
'locale' => $this->data['locale'] ?? null,
], function ($m) {
$m->from($this->data['fromEmail'], $this->data['fromName']);
$email = explode(',', $this->data['email']);
$m->to(trim($email[0]), $this->data['name'])->subject($this->data['subject']);
if (isset($this->data['replyToEmail']) && $this->data['replyToEmail']) {
$m->replyTo($this->data['replyToEmail'], $this->data['replyToName'] ?? null);
}
}); |
This is perfect thanks! Give me a day or two while I look into this for you. I think you might also be able to refactor this code to be more readable. I'll update you soon. |
@ndijkstra I wasn't able to reproduce the error on my end. Could you please send through some dummy data for |
I see there are some 422 errors visible in the Resend logs. It should have thrown that exception, instead of this error about null passing in the header. Response body: {
"statusCode": 422,
"name": "invalid_parameter",
"message": "Invalid `from` field. The email address needs to follow the `[email protected]` or `Name <[email protected]>` format"
} |
You're absolutely right about the error being returned as an exception. I actually already have a fix for that waiting for review: resend/resend-php#35 @bukinoshita could you please review the above PR as soon as you can. ❤️ |
@ndijkstra could you please try reinstall |
@jayanratna This still happening with |
Thanks for reporting this @wassim. I'll investigate and get back to you ASAP. 🙂 |
I'm getting this error from time to time:
Symfony\Component\Mime\Header\Headers::addTextHeader(): Argument #2 ($value) must be of type string, null given, called in /vendor/symfony/mime/Header/Headers.php on line 152
This is triggered by
vendor/resend/resend-laravel/src/Transport/ResendTransportFactory.php: 66
The text was updated successfully, but these errors were encountered: