Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

problem with Official PHP Client Library #57

Open
alexanderhofstaetter opened this issue Aug 25, 2017 · 1 comment
Open

problem with Official PHP Client Library #57

alexanderhofstaetter opened this issue Aug 25, 2017 · 1 comment

Comments

@alexanderhofstaetter
Copy link

i am using this plugin to send my wordpress mails via sendgrid. works perfectly. in my themes function.php file i want to do some custom api calls (get all bounces).

therefore i included the sendgrid php api library (github.com/sendgrid/sendgrid-php) via require_once in my functions.php file.

i get the following error

FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot declare class SendGrid\Email, because the name is already in use in /var/www/vhosts/xxx/wp-content/themes/xxx/vendor/sendgrid-php/lib/helpers/mail/Mail.php on line 877" while reading response header from upstream

when i deactivate the sendpress wordpress plugin, everything works fine. when i rename the Mail class in sendgrid-php/lib/helpers/mail/Mail.php on line 877 (in the Official PHP Client Library) it works also.

@sebastianplesciuc
Copy link
Contributor

Hi @alexanderhofstaetter

Your question is similar to this question asked on the plugin forum: https://wordpress.org/support/topic/sendgrid-wordpress-plugin-official-php-client-library/

You'll find a more detailed answer there. Basically this is not possible because the Wordpress plugin already relies and includes the official SendGrid PHP library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants