Attaching a file (PDF) to booking confirmation email

[ad_1]

Hi,

You can do so by adding this code to your theme’s functions.php file.

add_filter('wpbs_form_mailer_attachments', function($attachments, $email_type){
if($email_type == 'user'){ // types can be 'user', 'admin', 'payment', 'payment_success', 'reminder', 'followup'
$attachments[] = '/path/to/your/file.pdf';
}
return $attachments;
}, 50, 2);

Set the email you want the attachment to be included in, and add the path to your file. You can find the path from WP Admin -> Tools -> Site Health -> Info -> Directories and Sizes -> WordPress directory location.

Upload your file to WP Admin -> Media, grab the URL and replace the beginning of the URL with the path.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer