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

PHP error when sending test mail from settings panel #30

Closed
maxcoe opened this issue Nov 7, 2018 · 3 comments
Closed

PHP error when sending test mail from settings panel #30

maxcoe opened this issue Nov 7, 2018 · 3 comments

Comments

@maxcoe
Copy link

maxcoe commented Nov 7, 2018

Hello!

When I press the button "Send test mail" in the email settings panel, using the "sendmail" transport type, I get a PHP error saying "Undefined offset: 0" highlighting the line:

->setFrom([$settings->fromNamesEmails[0][1] => $settings->fromNamesEmails[0][0]])

Best regards and thank you for your support!

@putyourlightson
Copy link
Collaborator

Hi there. Sounds like you need to save the from name and email before sending a test email. I'll add better error handling in the next release.

@maxcoe
Copy link
Author

maxcoe commented Nov 7, 2018

Unfortunately it shows this error even when the email datas are saved... But I have solved the problem by changing the mentionned line to:

->setFrom(reset($settings->fromNamesEmails)[1])

The "reset" fonction takes the very first element of the array "fromNamesEmails", that means the very first element of the emails list in the settings panel. And "[1]" is the email address itself. Now it works fine!

@putyourlightson
Copy link
Collaborator

Thanks, will add this to the next relelase.

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

1 participant