Adding String Attachments (AddStringAttachment) with wp_mail
I couldn’t figure out how to add a string attachment to the notifications sent through wp_mail so I hacked something together — without modifying core files (as you might have seen in some Google search results).
So I pass an attachment that’s a json encoded array that will intentionally fail.
Since the attachment failed I’m looking at the error, retrieving the data passed and then using
AddStringAttachment directly with the newly created string.
Hopefully this can be easier with this ticket.
Leave A Comment