-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Bug]: From settings of email or notification are ignored #13
Comments
Hi @sanderbaas, Thank you for bringing this issue to our attention. I've attempted to replicate the problem using our test suite, but so far, I haven't been able to reproduce it. You can review the added test I conducted here: MicrosoftGraphTransportTest.php. It is within the "the configured mail sender can be overwritten" test. Based on these tests, the MSGraph Mailer appears to be functioning correctly. However, I'm keen to understand more about your experience. Could you provide some additional details or specific steps that might help us reproduce the issue on our end? Looking forward to your response. |
Hi @geisi , Thank you for your rapid response. I have done some tests myself and indeed the payload that is sent to Microsoft Graph contains the correct sender info. However, the endpoint that is used also contains the from email address. It is being supplied here: https://github.com/InnoGE/laravel-msgraph-mail/blob/main/src/LaravelMsGraphMailServiceProvider.php#L45 and eventually used here to create the actual API request: https://github.com/InnoGE/laravel-msgraph-mail/blob/main/src/MicrosoftGraphTransport.php#L58 When I manually change |
Thank you @sanderbaas I have fixed this issue just update your dependencies, and it should work as expected. Thank you! |
Thanks @geisi it is working now! |
What happened?
I have set the email from address in my .env file to [email protected] . When I send an email where I have specified another from address with
->from('[email protected]')
the email is still sent from the email address that was specified in the config.How to reproduce the bug
Set the EMAIL_FROM_ADDRESS in .env to one address and send an email with
->from('[email protected]')
.Package Version
1.0.5
PHP Version
8.2
Laravel Version
10
Which operating systems does with happen with?
Linux
Notes
Perhaps https://github.com/InnoGE/laravel-msgraph-mail/blob/main/src/MicrosoftGraphTransport.php#L58 should be changed (untested):
old
$this->microsoftGraphApiService->sendMail($this->from, $payload);
new
$this->microsoftGraphApiService->sendMail($this->transformEmailAddresses(collect($email->getFrom())), $payload);
The text was updated successfully, but these errors were encountered: