Gravity Forms email melléklet a felhasználónak

igen, mert <?php jel elé másold és majd írd át a 64-et a te formod ID-jára. amit a form listában találsz bal oldalt















<?php



add_filter(“gform_user_notification_attachments_64”, “add_attachment”, 10, 3);



function add_attachment($attachments, $lead, $form){



$fileupload_fields = GFCommon::get_fields_by_type($form, array(“hidden”));



if(!is_array($fileupload_fields))



return $attachments;



$attachments = array();



$upload_root = RGFormsModel::get_upload_root();



foreach($fileupload_fields as $field){



$url = $lead[$field[“id”]];



$attachment = preg_replace(’|^(.*?)/gravity_forms/|’, $upload_root, $url);



if($attachment){



$attachments[] = $attachment;



}



}



return $attachments;



}



?>



<?php



/**


  • @package WordPress


  • @subpackage U-Design



    /



    // Create Text Domain For the Themes’ Translations



    if (function_exists(‘load_theme_textdomain’)) {



    load_theme_textdomain(‘udesign’, get_template_directory().’/locale’);



    }



    // load styles



    function my_init_styles() {



    if( !is_admin() ){



    // get the desired color scheme



    global $udesign_options, $style;



    // Format the Google WebFonts as string



    if( $udesign_options[‘google_web_fonts_assoc’] ) {



    $google_fonts_string = implode( ‘|’, array_unique($udesign_options[‘google_web_fonts_assoc’]) );



    if( $google_fonts_string )



    printf(“rn”, str_replace(’ ‘, ‘+’, $google_fonts_string));



    }



    wp_enqueue_style(‘reset’, get_bloginfo(‘template_url’) . ‘/styles/common-css/reset.css’, false, ‘1.0’, ‘screen’);



    wp_enqueue_style(‘text’, get_bloginfo(‘template_url’) . “/styles/{$style}/css/text.css”, false, ‘1.0’, ‘screen’);



    wp_enqueue_style(‘grid-960’, get_bloginfo(‘template_url’) . ‘/styles/common-css/960.css’, false, ‘1.0’, ‘screen’);



    wp_enqueue_style(‘superfish_menu’, get_bloginfo(‘template_url’) . ‘/scripts/superfish-1.4.8/css/superfish.css’, false, ‘1.0’, ‘screen’);



    if ( $udesign_options[‘enable_prettyPhoto_script’] && !WP_PRETTY_PHOTO_PLUGIN_ACTIVE ) {



    wp_enqueue_style(‘pretty_photo’, get_bloginfo(‘template_url’) . ‘/scripts/prettyPhoto/css/prettyPhoto.css’, false, ‘3.1.3’, ‘screen’);



    }



    wp_enqueue_style(‘style’, get_bloginfo(‘template_url’) . “/styles/{$style}/css/style.css”, false, ‘1.0’, ‘screen’);



    wp_enqueue_style(‘custom-style’, get_bloginfo(‘template_url’) . ‘/styles/custom/custom_style.php’, false, ‘’, ‘screen’);



    if ( $udesign_options[‘enable_default_style_css’] ) {



    wp_enqueue_style(‘style-orig’, get_stylesheet_directory_uri() . “/style.css”, false, ‘1.0’, ‘screen’);



    }



    }



    }



    add_action(‘wp_print_styles’, ‘my_init_styles’);



    // load scripts



    function my_init_scripts() {



    if( !is_admin() ){



    global $udesign_options, $current_slider;







    // Load jQuery



    if( WP_PRETTY_PHOTO_PLUGIN_ACTIVE ) { // WP-prettyPhoto requires jquery 1.4.2



    wp_deregister_script( ‘jquery’ );



    wp_register_script( ‘jquery’, get_bloginfo(‘template_url’)."/scripts/jquery-1.4.2.min.js", false, ‘’ );



    }



    wp_enqueue_script(‘jquery’);









    <?php





    add_filter(“gform_user_notification_attachments_64”, “add_attachment”, 10, 3);





    function add_attachment($attachments, $lead, $form){





    $fileupload_fields = GFCommon::get_fields_by_type($form, array(“hidden”));





    if(!is_array($fileupload_fields))





    return $attachments;





    $attachments = array();





    $upload_root = RGFormsModel::get_upload_root();





    foreach($fileupload_fields as $field){





    $url = $lead[$field[“id”]];





    $attachment = preg_replace(’|^(.
    ?)/gravity_forms/|’, $upload_root, $url);





    if($attachment){





    $attachments[] = $attachment;





    }





    }





    return $attachments;





    }





    ?>





    <?php





    /**




  • @package WordPress




  • @subpackage U-Design





    */





    // Create Text Domain For the Themes’ Translations





    if (function_exists(‘load_theme_textdomain’)) {





    load_theme_textdomain(‘udesign’, get_template_directory().’/locale’);





    }





    // load styles





    function my_init_styles() {





    if( !is_admin() ){





    // get the desired color scheme





    global $udesign_options, $style;





    // Format the Google WebFonts as string





    if( $udesign_options[‘google_web_fonts_assoc’] ) {





    $google_fonts_string = implode( ‘|’, array_unique($udesign_options[‘google_web_fonts_assoc’]) );





    if( $google_fonts_string )





    printf(“rn”, str_replace(’ ', ‘+’, $google_fonts_string));





    }





    wp_enqueue_style(‘reset’, get_bloginfo(‘template_url’) . ‘/styles/common-css/reset.css’, false, ‘1.0’, ‘screen’);





    wp_enqueue_style(‘text’, get_bloginfo(‘template_url’) . “/styles/{$style}/css/text.css”, false, ‘1.0’, ‘screen’);





    wp_enqueue_style(‘grid-960’, get_bloginfo(‘template_url’) . ‘/styles/common-css/960.css’, false, ‘1.0’, ‘screen’);





    wp_enqueue_style(‘superfish_menu’, get_bloginfo(‘template_url’) . ‘/scripts/superfish-1.4.8/css/superfish.css’, false, ‘1.0’, ‘screen’);





    if ( $udesign_options[‘enable_prettyPhoto_script’] && !WP_PRETTY_PHOTO_PLUGIN_ACTIVE ) {





    wp_enqueue_style(‘pretty_photo’, get_bloginfo(‘template_url’) . ‘/scripts/prettyPhoto/css/prettyPhoto.css’, false, ‘3.1.3’, ‘screen’);





    }





    wp_enqueue_style(‘style’, get_bloginfo(‘template_url’) . “/styles/{$style}/css/style.css”, false, ‘1.0’, ‘screen’);





    wp_enqueue_style(‘custom-style’, get_bloginfo(‘template_url’) . ‘/styles/custom/custom_style.php’, false, ‘’, ‘screen’);





    if ( $udesign_options[‘enable_default_style_css’] ) {





    wp_enqueue_style(‘style-orig’, get_stylesheet_directory_uri() . “/style.css”, false, ‘1.0’, ‘screen’);





    }





    }





    }





    add_action(‘wp_print_styles’, ‘my_init_styles’);





    // load scripts





    function my_init_scripts() {





    if( !is_admin() ){





    global $udesign_options, $current_slider;











    // Load jQuery





    if( WP_PRETTY_PHOTO_PLUGIN_ACTIVE ) { // WP-prettyPhoto requires jquery 1.4.2





    wp_deregister_script( ‘jquery’ );





    wp_register_script( ‘jquery’, get_bloginfo(‘template_url’)."/scripts/jquery-1.4.2.min.js", false, ‘’ );





    }





    wp_enqueue_script(‘jquery’);





Most így csináltam, de az eredmény ugyan az lett.











Nem értem.

MOST JÓ! :slight_smile:

És ki is küldi? :slight_smile:

most teszteltem, de ki még nem küldi a dög. :slight_smile:

Lehet, hogy a hidden mezőt állítom be rosszul?











Bár ott sok lehetőség nincs, hogy elronthassam.

Laci te kipróbáltad? Neked működik?

Találtam egy ilyet a neten:















add_filter(“gform_user_notification_attachments”, “add_attachment”, 10, 3);



function add_attachment($attachments, $lead, $form){







//getting wordpress upload folder



$upload = wp_upload_dir();



$upload_path = $upload[“path”];







$attachments = array();







//add a file from the uploads folder



$attachments[] = $upload_path . “/my_file.jpg”;







//attaching another file. add a new like like this for each file you would like to attach.



//remove this line if you only need one attachment



$attachments[] = $upload_path . “/2010/06/another_file_in_a_subfolder.jpg”;







return $attachments;



}











Ez alapján gy néz ki, mintha a fájl elérési útját is bele kéne írni a kódba.



Vagy mi a szösz. :slight_smile:






        • -







          Nem lehet, hogy kihagytam valamit?







          1.



          beilleszettem a kódot, amit adtál a functions-php fájl elejére.







          a form id-ját átírtam a használatban lévő form id-jára.







          2.



          a form-ba raktam egy hidden részt, aminek az Advanced fülén megadtam fájl pontos elérési útját.



          Ami így néz ki:



          http://weboldalam.co…/teszt_fajl.doc







          De nem történik semmi.







          Próbáltam azt is, hogy a user emailbe beleraktam a hidden rész MERGE tag-jét.







          De akkor csak annyi történt, hogy beleírta az emailbe az a fájl elérési útvonalát.







          ???





          add_filter(“gform_user_notification_attachments”, “add_attachment”, 10, 3);





          function add_attachment($attachments, $lead, $form){











          //getting wordpress upload folder





          $upload = wp_upload_dir();





          $upload_path = $upload[“path”];











          $attachments = array();











          //add a file from the uploads folder





          $attachments[] = $upload_path . “/my_file.jpg”;











          //attaching another file. add a new like like this for each file you would like to attach.





          //remove this line if you only need one attachment





          $attachments[] = $upload_path . “/2010/06/another_file_in_a_subfolder.jpg”;











          return $attachments;





          }

















          Ez alapján gy néz ki, mintha a fájl elérési útját is bele kéne írni a kódba.





          Vagy mi a szösz. :slight_smile:










        • -











          Nem lehet, hogy kihagytam valamit?











          1.





          beilleszettem a kódot, amit adtál a functions-php fájl elejére.











          a form id-ját átírtam a használatban lévő form id-jára.











          2.





          a form-ba raktam egy hidden részt, aminek az Advanced fülén megadtam fájl pontos elérési útját.





          Ami így néz ki:





          http://weboldalam.co…/teszt_fajl.doc











          De nem történik semmi.











          Próbáltam azt is, hogy a user emailbe beleraktam a hidden rész MERGE tag-jét.











          De akkor csak annyi történt, hogy beleírta az emailbe az a fájl elérési útvonalát.











          ???

ID-t megadtad?

igen, megadtam az ID-t.











Ha beillesztem a linket valahova és rákattintok, akkor egyből le akarja tölteni, szóval jó a link is.











Ha adok hozzáférést az oldalamhoz, ránéznél? :))

Igen, küldd el privátban.

küldtem privát üzenetet.