How to add attachments to email?

It is possible to add attachments to your custom emails by using the filter "rp_wcec_email_attachments". Here's the example (make sure to change key and path to appropriate values):

add_filter('rp_wcec_email_attachments', 'change_rp_wcec_email_attachments');

function change_rp_wcec_email_attachments($attachments, $rp_wcec_email_object) {
    $attachment_key = 'attachment key';
    $attachment_path = 'attachment file path';
    $attachments[$attachment_key] = $attachment_path;
    return $attachments;
}

As you can see there's also email object passed - $rp_wcec_email_object. You can check it's properties to be able to add different attachments based on your own conditions.

Have more questions? Submit a request