magepal / magento2-gmail-smtp-app

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
https://www.magepal.com
319 stars 147 forks source link

Not compatible with Magento 2.3.0 #125

Closed webspeaks closed 5 years ago

webspeaks commented 5 years ago

This plugin seems to be incompatible with Magento 2.3.0. When I try to send any email, it gives the following error in logs:

PHP Fatal error:  Uncaught Error: Call to undefined method Magento\Framework\Mail\Message\Interceptor::getFrom() in /magento1/vendor/magepal/magento2-gmailsmtpapp/Plugin/Mail/TransportPlugin.php:75
Stack trace:
#0 /magento2/vendor/magepal/magento2-gmailsmtpapp/Plugin/Mail/TransportPlugin.php(49): MagePal\GmailSmtpApp\Plugin\Mail\TransportPlugin->sendSmtpMessage(Object(Magento\Framework\Mail\Message\Interceptor))
#1 /magento2/vendor/magento/framework/Interception/Interceptor.php(135): MagePal\GmailSmtpApp\Plugin\Mail\TransportPlugin->aroundSendMessage(Object(Magento\Email\Model\Transport\Interceptor), Object(Closure))
#2 /magento2/vendor/dotmailer/dotmailer-magento2-extension/Plugin/TransportPlugin.php(74): Magento\Email\Model\Transport\Interceptor->Magento\Framework\Interception\{closure}()
#3 /magento2/vendor/magento/framework/Interception/Interceptor.php(135): Dotdigitalgroup\Email\ in /magento2/vendor/magepal/magento2-gmailsmtpapp/Plugin/Mail/TransportPlugin.php on line 75

Also during code compile, It gives following error:

-bash-4.2$ php bin/magento setup:d:c
Compilation was started.
Area configuration aggregation... 5/7 [====================>-------]  71% 40 secs 364.0 MiB
In ClassReader.php line 35:
  Class Magento\Email\Model\Source\Variables does not exist
In ClassReader.php line 29:
  Class Magento\Email\Model\Source\Variables does not exist

Magento version #: 2.3.0

Edition (EE, CE, OS, etc): CE

Expected behavior: Should have sent email

Actual behavior: Emails not being sent.

Steps to reproduce: Send order emails from admin.

Preconditions

srenon commented 5 years ago

@webspeaks ... what version of our extension are you using?

root@magentoos23:magentoOS2.3/magento2ce# php bin/magento setup:di:compile Compilation was started. Interception cache generation... 7/7 [============================] 100% 1 min 317.0 MiB Generated code and dependency injection configuration successfully.

srenon commented 5 years ago

I will have an update shortly to address Call to undefined method Magento\Framework\Mail\Message\Interceptor::getFrom()

webspeaks commented 5 years ago

@srenon I just installed the fresh extension yesterday. So it should be on the latest version.

Artem-Schander commented 5 years ago

@srenon FYI In TransportPlugin@sendSmtpMessage $message is not instance of Zend_Mail. Besides that, $message->setReturnPath($returnPathEmail); and $message->setReplyTo($returnPathEmail); are not available too.

srenon commented 5 years ago

@Artem-Schander .... I know... I'm working on a patch

Artem-Schander commented 5 years ago

@srenon Let me know if i can help somehow ;)

srenon commented 5 years ago

@webspeaks & @Artem-Schander ... can you test 2.6.0 and let me know if you have any issues?

webspeaks commented 5 years ago

@srenon I updated to latest version. But still facing the same issue. image

Artem-Schander commented 5 years ago

For me it works fine. Many Thanks @srenon ! BTW. Nice reaction time, absolutely worth a star 👍

srenon commented 5 years ago

@webspeaks ... that class is not used in our module, so try to disable/remove our module and try di:compile to see if the issue still exists.

Also, do a search for "Magento\Email\Model\Source\Variables" they should be only one instance of it in dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php

srenon commented 5 years ago

@Artem-Schander ... Thanks,

Also, did you run di:compile?

Artem-Schander commented 5 years ago

Yep. I've successfully run the cache / setup / compile commands.

webspeaks commented 5 years ago

@Artem-Schander It is fixed now. It was the issue with some other extension. Sorry for the false alarm.