I had some issues a week or so ago getting a custom view PDF to attach to admin and applicant notifications.
Rob LeVine helped me sort it out with the code blow and it worked great for the two forms I had at the time.
I've now duplicated one of those forms and added a new View for it and as far as I can tell I've updated all the different settings but nothing is attaching to either email. The link that appears on the confirmation page [frm-pdf view=597 entry="[id]" public=1] is working correctly.
This is the original code I had:
add_filter( 'frm_pdfs_email_attachment_args', 'add_view_to_attached_pdf', 10, 2 );
function add_view_to_attached_pdf( $pdf_args, $args ) {
$args_set = false;
switch($args['form']->id) {
case 6:
$pdf_args['view'] = 554;
$args_set = true;
break;
case 7:
$pdf_args['view'] = 574;
$args_set = true;
break;
default:
break;
}
if ($args_set) {
$pdf_args['id'] = $args['entry']->id; // Do this to show the detail view, otherwise, it shows the listing view.
return $pdf_args;
}
}
This is how I updated it to include the new form ID 8 and View ID 597:
add_filter( 'frm_pdfs_email_attachment_args', 'add_view_to_attached_pdf', 10, 2 );
function add_view_to_attached_pdf( $pdf_args, $args ) {
$args_set = false;
switch($args['form']->id) {
case 6:
$pdf_args['view'] = 554;
$args_set = true;
break;
case 7:
$pdf_args['view'] = 574;
$args_set = true;
break;
case 8:
$pdf_args['view'] = 597;
$args_set = true;
break;
default:
break;
}
if ($args_set) {
$pdf_args['id'] = $args['entry']->id; // Do this to show the detail view, otherwise, it shows the listing view.
return $pdf_args;
}
}
Can anyone tell me what I've missed? TIA
And in case it helps here is the link to the form in question...
https://huntprosperity.com.au/stonepoint-application/
Your link is triggering security warnings so I'm not going to visit the form. Are you certain the duplicated form id is 8?