Sziasztok!
Elakadtam a Gravity Forms-szal.
Szerintem hiányzik a Gravity Forms-ból egy fontos funkció, a melléklet csatolása a kimenő emaileknél.
Elméletileg van erre megoldás, amit le is írnak a weboldalukon, de azokat nem egyeszerű földi halandóknak szánták, hanem annak, aki ért a PHP, vagy HTML programozáshoz.
Én szeretek barkácsolgatni, de ez kifogott rajtam.
El tudja valaki magyarázni, hogy akkor most mi is a teendő?
Itt a használati utasítás:
http://www.gravityhe…ion_attachments
Description
This filter can be used to add attachments to the user notification email.
Usage
1 <?php
2 add_filter("gform_user_notification_attachments", "add_attachment", 10, 3);
3 ?>
You can also target a specific form by adding the form id after the hook name.
1 <?php
2 //This filter declaration targets a form whose id is 6
3 add_filter("gform_user_notification_attachments_6", "add_attachment", 10, 3);
4 ?>
Parameters
$attachments (string/array) The attachments to be filtered. This parameter will be passed to the filter as a blank string. To add attachments, set it to a string (containing the full file path) for one attachment or an array of strings (file paths) for multiple attachments.
$entry (Entry Object) Current entry object.
$form (Form Object) Current form object.
Examples
This example attaches all file upload fields in the form to the user notification email.
01 <?php
02 add_filter("gform_user_notification_attachments", "add_attachment", 10, 3);
03 function add_attachment($attachments, $lead, $form){
04 $fileupload_fields = GFCommon::get_fields_by_type($form, array("fileupload"));
05
06 if(!is_array($fileupload_fields))
07 return $attachments;
08
09 $attachments = array();
10 $upload_root = RGFormsModel::get_upload_root();
11 foreach($fileupload_fields as $field){
12 $url = $lead[$field["id"]];
13 $attachment = preg_replace('|^(.*?)/gravity_forms/|', $upload_root, $url);
14 if($attachment){
15 $attachments[] = $attachment;
16 }
17 }
18
19 return $attachments;
20 }
21 ?>
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in common.php
_______________________________________________________________
A leírás alapján nagyon egyszerűnek tűnik, de mégsem tudom megfejteni. :)))