I’ve compared the Notifications screen of my form to that of the example form and they’re identical. I’ve also compared the form settings. Identical.
This is the code I’ve added to my theme’s functions.php
function gform_pdf_create($entry, $form)
{
$user_id = $entry['id'];
$form_id = $entry['form_id'];
/* only output PDF if the $form_id matches */
/* 4 is the ID for the second half of the contract */
if($form_id == 4)
{
/* include the pdf processing file */
require PDF_PLUGIN_DIR.'render_to_pdf.php';
/* generate and save default PDF */
//$filename = PDF_Generator($form_id, $user_id, 'save', true);
/* comment out the above line and uncomment the line below if you want to use a custom template */
$filename = PDF_Generator($form_id, $user_id, 'save', true, 'example-template.php', 'EasternEdgePolicyContract.pdf');
}
}
add_action("gform_entry_created", "gform_pdf_create", 10, 2);
and
function gform_add_attachment($attachments, $lead, $form){
$form_id = $lead['form_id'];
$user_id = $lead['id'];
$attachments = array();
$folder_id = $form_id.$user_id.'/';
/* 4 is the ID of the second half of the contract */
if($form_id == 4)
{
/* include PDF converter plugin */
include PDF_PLUGIN_DIR.'render_to_pdf.php';
//$attachment_file = PDF_SAVE_LOCATION. $folder_id . get_pdf_filename($form_id, $user_id);
$attachment_file = PDF_SAVE_LOCATION. $folder_id . 'FormName.pdf';
$attachments[] = $attachment_file;
}
return $attachments;
}
/* add attachment to both the admin and user notification */
add_filter("gform_admin_notification_attachments", 'gform_add_attachment', 10, 3);
add_filter("gform_user_notification_attachments", 'gform_add_attachment', 10, 3);
Can you help any more?