I installed the modue following this instruction.
- download module mailgun
- download libraries at https://github.com/mailgun/mailgun-php/tree/v1.7.2
- Extract the downloaded module in folder sites/all/libraries folder sẽ như thế này sites/all/libraries/mailgun.
- Enable module. Goto config admin/config/system/mailgun
- There comes the message "The Mailgun PHP library is not installed. Please see documentation for more information." then could not save api key.
- After checking, I see that the problem comes from declaring libraries

'version arguments' => array(
      'file' => 'vendor/mailgun/mailgun-php/src/Mailgun/Constants/Constants.php',
      // const SDK_VERSION = "1.7";
      'pattern' => '/const SDK_VERSION = \"((\d+)\.(\d+))\";/',
    ),

- The file path is incorrect. The code needs to be changed to:

'version arguments' => array(
      'file' => 'src/Mailgun/Constants/Constants.php',
      // const SDK_VERSION = "1.7";
      'pattern' => '/const SDK_VERSION = \"((\d+)\.(\d+))\";/',
    ),

so that libraries can be detected. Or just download at Mailgun libraries

Comments

doidd created an issue. See original summary.

doidd’s picture

Title: Libraries not detect » Libraries can not be detected
jalpesh’s picture

I have download the library from same location but the file is at vendor/mailgun/mailgun-php/src/Mailgun/Constants/Constants.php which was mention in module. I think the file path is different based on library download, if i download it from https://github.com/mailgun/mailgun-php then the file path will be different. I think maintainer will be best person to comment on this. Thanks

  • SpartyDan committed 41a297f on 7.x-1.x
    Issue #2752117 by doidd: Libraries can not be detected
    
SpartyDan’s picture

I have updated the Mailgun Documentation to reflect that the recommended method of installation for the Mailgun library has changed. The Mailgun library should be installed using the code on GitHub. I am tagging a new release (Mailgun-7.x-1.6) to update the code to fix the issue with the expected path to the library.

matt b’s picture

The Mailgun Documentation is not correct. Please see my comment here: https://www.drupal.org/node/2547591#comment-11482439

Jeffrey C.’s picture

Status: Active » Closed (duplicate)
Related issues: +#2781043: Fatal error: Class 'Mailgun\Mailgun'