Attach files to Email notification
-
Hi @ovann86,
thanks for your plugin!
I’m currently also using this plugin to enable sending the uploads as attachments to the admin:
https://ww.wp.xz.cn/plugins/gf-upload-to-email-attachment/Is there a way to attach all uploads to notification emails with your plugin as well?
Thanks!
Harry
-
I like the idea.
I’ll have a go at adding this to this plugin. Probably take a week to do though?
That would be awesome 🙂
Here are some other resources I found, maybe helpful, maybe not 😉Renaming uploaded files – probably not so important for the feature
https://gist.github.com/spivurno/cd0adb3d45186022bea0And an article from GF:
https://www.gravityhelp.com/documentation/article/gform_notification/#6-attach-single-or-multi-file-file-uploadsLooking forward to the feature! Maybe there is even an easy way to make it work with the “GF upload to email attachment”-plugin?
Hey,
I’ve done the work but haven’t completely finished everything I wanted to do before pushing out the next update.
If you’re itching to use this feature and feel comfortable manually installing a plugin … you can use this version of the plugin.
I would install it by connecting to your server using FTP, backing up a copy of the current plugin (e.g. download to your computer) and replace it with the extract from the ZIP.
demo.itsupportguides.com/downloads/ajax-upload-for-gravity-forms1.8.4.1.zipOnce installed you should see some new options at the bottom of your notification that’ll control the feature.
Let me know if you do test it out, it’ll give me a chance to refine it before it’s released.
There seems to be a little display bug in AJAX list uploads:
- upload test.pdf
- add additional upload list item via click on “plus symbol”
- upload myCat.jpg => progress bar shows “test.pdf” as filename
- when the upload is finished, the correct thumbnail of myCat.jpg is displayed
This is kinda funny when you upload 2 images. The progress bar of the second image upload shows the thumbnail of the first image 🙂
Tested here: http://www.cheapenergy24.de/gf-testformular/
Disclaimer: I also had this filter active in functions.php
/** * Filter for Gravity Forms AJAX Upload plugin to rename files * https://ww.wp.xz.cn/support/plugin/ajax-upload-for-gravity-forms */ function my_itsg_gf_ajaxupload_filename( $name, $file_path, $size, $type, $error, $index, $content_range ) { $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : null; // get the field_id out of the post $file_extension = pathinfo( $name, PATHINFO_EXTENSION ); // get the file type out of the URL $file_name = pathinfo( $name, PATHINFO_FILENAME ); // get the file name $time = time(); // timestamp $name = $time . "_" . $file_name . "." . $file_extension; // put it together return $name; // now return the new name } add_filter( 'itsg_gf_ajaxupload_filename', 'my_itsg_gf_ajaxupload_filename', 10, 7 );The ZIP-attachment to the admin notification email worked perfectly. Maybe the naming of the zip file could be improved to avoid conflicts and to make it more easily identifyable. E.g. by adding a unix timestamp or maybe use some merge tags for naming.
New link to the test form:
http://www.cheapenergy24.de/anmeldung-mit-rechnungsupload/
The upload is at “Rechnungsupload”Hey,
Thanks I see what you mean now.Im also in the middle of changing the presentation slightly, so version 1.8.4.1 is half way through the change and not right.
Hopefully I’ll have a working version in the next 24 hours, in the meanwhile though stick with 1.8.4 in production if the bug isnt in that version too.
Now that you’ve seen it I’ll switch back to 1.8.4 for the website – thanks 😉
Hey,
Just letting you know Im about to push out version 2.0.0 which will include this feature.
I also added an option in the Gravity Forms -> Settings -> Ajax Upload menu for setting the file name for the ZIP file.
I’ll appreciate if you can get it a whirl and let me know if there are any issues.
Cheers,
Works pretty smoothly, nice update!
Here is some feedback, I made a screencast for some of the items, check it out here:
http://screencast-o-matic.com/watch/cD1qQ6iriD– Improvement: add {timestamp} as variable for naming the uploaded (zip) file(s)
– Translation: translation for frontend (“remove”, “cancel”, “uploading”) – I could help with German
– Nice to have: detection of duplicate files being uploaded (filename/path/size)
– Glitch: clicking the Submit button during an upload should not be possible. Setting it deactivated/disabled would be good. Clicking it right now shows a little animated circle, nothing happens and the circle won’t go away. You’ll see it in the video.
– Glitch: I’m uploading multiple files, then deleting some and uploading again. Now when pressing Submit more thumbnails show for a split-second (visible at the end of my video)
– Feature: Add logical conditions for the fields in the form editor – this one would be awesome 😀 Here is an example: If at least one file is uploaded, show/hide another form field.Thanks for this awesome plugin, good work!
Hey,
Thanks for the feedback.
Im working on another update which I hope to release shortly, 2.0.1.
1 – timestamp
Can do. It’ll use the PHP time() function that generates a unix time stamp.
2 – translation
Can do – I’ll add options in the settings page. Although these strings are translatable through the standard wordpress __() way. But I dont know enough to say how to best do it.
3 – duplicate files
I dont think I can do this. This plugin uses the blueimp file upload plugin, if you can figure out if it can do anything like that I’ll see if I can implement it in this plugin.
For my use of this plugin I would not use this feature as I would prefer to have copies then to risk overwriting a copy of a file that happens to have the same name but isn’t the same file/version.
4- loading GIF glitch
Thanks – I dont use Ajax enabled forms so didnt pick up on this.
5- mystery thumbnails
I saw this in the video but couldnt reproduce it. Does it happen every time?
Do you know if you have any other custom scripts that run on submit? Unlikely but worth asking.
6- feature – logical conditions
I’ll start thinking this through. Not sure how it would be implemented.
I’m thinking a JavaScript trigger you can hook into.E.g. after the upload is completed you can inject your own code to say ‘if x do x’.
Wouldn’t be something I would set up an interface for, it’ll be code you add to the page footer (not difficult to do or uncommon).
Thanks again, the video helped.
Ill answer when im back from vacation, sorry for the Delay!
1. + 2. + 4. nice!
3. good point, leave it as it is
5. Regarding the mystery thumbnails: I think it only happens when uploading/removing/uploading again multiple files. Maybe the thumbnails of the removed files show up again? I removed all scripts just to make sure, but it happens anyway.
6. would be very cool! I just want to clarify that I mean the default Gravity Forms function. Here is an image: https://s31.postimg.org/3mxw0xptn/2016_07_13_conditional_logic.png
The topic ‘Attach files to Email notification’ is closed to new replies.