I have installed sengrid integration module add api key in secret key in sendgrid settings page. After this I tried to send test mail at admin/config/services/sendgrid/test After clicking send test message button it throws some error which I attached in screenshot and not sending mail. Kindly help me.
http://www.awesomescreenshot.com/image/1118426/5f811f0867f69f32ce8e25b57...

And accessing sendgrid reports page displays errors page with this message

The website encountered an unexpected error. Please try again later.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

user77 created an issue. See original summary.

user77’s picture

Perignon’s picture

I just ran into this last night. I am troubleshooting it right now.

Did you install the API library with Composer Manager?

Perignon’s picture

Title: Test mail not working » Emails are not sending due to possible conflict in downloaded libraries

  • Perignon committed 91d51cd on 7.x-1.x
    Issue #2695867: Emails are not sending due to possible conflict in...
Perignon’s picture

So the first thing I found is the official Sendgrid library is creeping into the composer dependencies unless you use --no-dev in the composer manager update. I just updated the README installation instructions for that. I had to blow away my composer files and rebuild to correct that.

I found some other minor bugs I am working through now. Give me 24 to 48 hours and I should have this fixed.

Perignon’s picture

Assigned: Unassigned » Perignon
Perignon’s picture

user77’s picture

Regarding #3 I have installed composer manager and enabled sendgrid_integration. I have installed sendgrid dependencies using composer update command.

After installing sendgrid and dependencies site is not opening, when checked watchdog I found this error too.
PHP Fatal error: Class 'DrupalWebTestCase' not found in /home/linux/Public/drupal7/sites/all/modules/contrib/sendgrid_integration/tests/sendgrid_integration.test on line 12

  • Perignon committed 2c779fc on 7.x-1.x
    Issue #2695867: Correct small bugs in test email UI.
    
Perignon’s picture

DrupalWebTestCase is part of the simpletest/testing module in core. It shouldn't be loading that unless you are running tests.

Perignon’s picture

@user77 Can you check your sites/all/libraries/composer and tell me what it downloaded. Just a list of the folders is all I need.

You should have a folder called "fastglass" and in it should be another folder called "sendgrid"

You should not have this in that folder "sendgrid/sendgrid". You should have "sendgrid/smtpapi"

Perignon’s picture

I got the correct dependencies loaded in testing: https://travis-ci.org/taz77/drupal-sendgrid_integration/jobs/119170600

user77’s picture

@perignon I dont have any folder called composer inside sites/all/libraries

user77’s picture

Issue summary: View changes
Perignon’s picture

@user77 Let me see where else composer manager puts stuff. I was able to get the test email to send. I am checking other things out. My biggest problem locally was for some reason composer was loading the official library of the Sendgrid API instead of my forked version (I may rename the library).

Perignon’s picture

Do you have a sites/all/vendor?

If not, search your code base for the fine 'SendGrid.php" this will tell you where composer is putting the files.

user77’s picture

Yes I have sites/all/vendor. SendGrid.php is under /sites/all/vendor/fastglass/sendgrid/lib/SendGrid.php

Perignon’s picture

Ok so you got the correct library. I am getting the same error you are getting with the missing class when I install the latest code. So I am trying to determine why it's attempting to load the test files.

If I have to, I will remove the test code for now in the reports module. I have not started writing any of the actual tests yet. Just created empty test files.

Perignon’s picture

Ok I found this problem. It's with Mailsystem and not the module. There is a bug in Mailsystem that is loading the test files. This is fixed in the latest dev of Mailsystem (2.x and 3.) but not in the current "released" version of Mailsystem which is very old.

Here is another module that had the same problem over a year ago #2306373: Fatal error: Class 'DrupalWebTestCase' not found in ...sites/all/modules/protected_node/tests/protected_node.test on line 11

For now, I am just going to remove the tests till I can have time to write tests.

user77’s picture

@perignon Thanks. I can send test mails. If you don't mine can you tell me how to use sendgrid substitution tags in emails

  • Perignon committed 50d87d3 on 7.x-1.x
    Issue #2695867: Rename test file to except the bug in Mailsystem.
    
Perignon’s picture

Ok, I have pushed a fix to the problem. I will package another beta release now since Beta1 is essentially broken because of this.

Perignon’s picture

Release will be live soon: https://www.drupal.org/node/2696093

user77’s picture

Okay. I have asked add substitution token. Can you tell me because I cannot find any resources regarding this.

Perignon’s picture

I am not sure what you are referring to?

Perignon’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.