How to do string attachment with wp_mail
It is possible to add an attachment using the standard ‘wp_mail’ function, however you would need to hook into the phpmailer_init action to do so. Because this will require calling another function where you don’t have any context, you may need to register the action function anonymously with the use ( $attachments ) statement, store … Read more