wp_mail Allow Remote Attachments from CDN
I came across a problem with WP_Mail for sending form submissions with file attachments. Our site uses a CDN, so everything uploaded to the site, whether images and media by site builders or documents by users gets put on an external server.
This poses a problem for WP_Mail because it uses the PHPMailer addAttachment method to attach files, which expects local files. I was able to fix this by changing the line in wp_mail to use addStringAttachment, but of course modifying core files isn't really a fix. What is the right way to do this?
Thanks.
Topic wp-mail attachments cdn Wordpress
Category Web