Hello,
I am trying to use the Cognetif ApiMail app with SendGrid.
- I created an account at SendGrid and have an API-key;
- I installed the app via the zip-upload to the server;
- Then I used composer inside /perch/addons/apps/cognetif_apimail to install sendgrid etc;
- I added cognetif_apimail to my apps.php;
- In my config.php I added the following:
Code
- define('PERCH_EMAIL_FROM', 'my_email');
- define('PERCH_EMAIL_FROM_NAME', 'Mike');
- define('PERCH_EMAIL_USERNAME', 'my_email');
- define('PERCH_EMAIL_METHOD', 'api');
- define('COGNETIF_APIMAIL_CONNECTOR', '\Cognetif\ApiMail\Connections\SendGridApi');
- define('COGNETIF_APIMAIL_SENDGRID_KEY', 'MY_SENDGRID_API_KEY');
- I created a perch form template;
- I filled the form options in Perch to send a response and autoresponse;
- When submitting the form on my website I get the following PHP error(s):
Code
- [Sun Jan 12 14:14:08.525337 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: Return value of Cognetif\\ApiMail\\Manager::email_send() must be an instance of Cognetif\\ApiMail\\void, none returned in [MY_PATH]/perch/addons/apps/cognetif_apimail/lib/Cognetif/ApiMail/Manager.php:49, referer: http://[MY_DOMAIN]/contact
- [Sun Jan 12 14:14:08.525505 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: Stack trace:, referer: http://[MY_DOMAIN]/contact
- [Sun Jan 12 14:14:08.525511 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: #0 [MY_PATH]/perch/core/lib/Perch.class.php(232): Cognetif\\ApiMail\\Manager::email_send(Object(PerchSystemEvent)), referer: http://[MY_DOMAIN]/contact
- [Sun Jan 12 14:14:08.525516 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: #1 [MY_PATH]/perch/core/lib/PerchEmail.class.php(337): Perch->event('email.send', Object(PerchSystemEventSubject)), referer: http://[MY_DOMAIN]/contact
- [Sun Jan 12 14:14:08.525521 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: #2 [MY_PATH]/perch/addons/apps/perch_forms/PerchForms_Form.class.php(304): PerchEmail->send(), referer: http://[MY_DOMAIN]/contact
- [Sun Jan 12 14:14:08.525525 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: #3 [MY_PATH]/perch/addons/apps/perch_forms/PerchForms_Form.class.php(142): PerchForms_Form->_send_email(Object(stdClass), Array), referer: http://[MY_DOMAIN]/contact
- [Sun Jan 12 14:14:08.525529 2020] [fcgid:warn] [pid 25969:tid 140225908926208] [client 163.158.104.251:49850] mod_fcgid: stderr: #4 /home/kndrxwbst/domains/kend in [MY_PATH]/perch/addons/apps/cognetif_apimail/lib/Cognetif/ApiMail/Manager.php on line 49, referer: http://[MY_DOMAIN]/contact