API Docs
-
Hi there,
I’m the developer of bbpress Notify (No-Spam) plugin, and in it I hook into PHPMailer to add attachments (inline or otherwise). As you replace PHPMailer with Zend, how can I hook into your code to add those attachments? Do you have some documentation I can refer to?
Cheers,
Vinny
-
Hi
Nice to meet 🙂
Why you need to hook phpmailer ?
My plugin sends out notifications of new bbPress topics/replies, and if there are inline images, it converts them to CID sources with
Content-disposition: inlineheaders. I do this because some email clients don’t like external images and block them.It’s pretty low level message manipulation, and it assumes that PHPMailer is still available. When using Postman SMTP, the messages go out without the images. Reading your readme.txt explains why – you replace PHPMailer with Zend.
So in order for my plugin to play nicely with yours, I need to find a way to attach the images to the message.
Cheers,
VinnyHi @usestrict
I have added the
phpmailer_inithook to the class doing all the setup in my plugin and added the same methods you need.My file and the relevant methods are located here:
/post-smtp/Postman/Postman-Mail/PostmanMessage.phpIn case it doesn’t work, just update me.
Please download the dev version here:
https://downloads.wp.xz.cn/plugin/post-smtp.zipThanks! Much appreciated! I’ll let you know if everything is working well.
Cheers,
VinnyAny news?
Hi @yehudah,
The hook exists and my code is calling
->addEmbeddedImage(), but the images aren’t attached to the message.Also, I get the following errors:
[04-Jun-2018 21:10:20 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php on line 132 [04-Jun-2018 21:10:20 UTC] PHP Warning: fopen() expects parameter 1 to be a valid path, array given in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php on line 136 [04-Jun-2018 21:10:20 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php on line 132 [04-Jun-2018 21:10:20 UTC] PHP Warning: fopen() expects parameter 1 to be a valid path, array given in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php on line 136 [04-Jun-2018 21:10:20 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php on line 132 [04-Jun-2018 21:10:20 UTC] PHP Warning: fopen() expects parameter 1 to be a valid path, array given in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php on line 136 [04-Jun-2018 21:10:20 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php:132) in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-admin/post.php on line 198 [04-Jun-2018 21:10:20 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-content/plugins/post-smtp/Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php:132) in /Volumes/Sites/wordpress_plugins/wp_unittest/wordpress/wp-includes/pluggable.php on line 1216Cheers,
Vinny
The topic ‘API Docs’ is closed to new replies.