WordPress plugin

Dynamic Attachments for Gravity Forms

Add your own files to any Gravity Forms notification, from a fixed list or from the page the form was on, including private files whose web address is never shown.

Gravity Forms can attach the files a visitor uploads. It cannot attach a file you already have, such as a brochure, a price list or the guide a page is about. Dynamic Attachments adds that to each notification on its own. Open a notification and you will find an Additional attachments section with two switches. Nothing changes until you turn one on.

Static files per notification

The page’s own files, automatically

Private files, never shown by address

Held back, never sent short

Free on WordPress.org. No account, no licence key. WordPress 6.0 or later, Gravity Forms 2.5 or later.

The Problem

Gravity Forms sends uploads, not your files

Gravity Forms can attach the files a visitor uploads. It has no way to attach a file you already have, such as a brochure, a price list or the guide a page is about. The usual workarounds each cost something.

A link in the email is a public address

Paste a download link into the message and anyone who gets it can pass it on. A search engine can find a public file, and the address never expires.

One form, many guides

A site with a guide on every page needs a form and a notification for each one, or a hidden field and a merge tag kept in step by hand.

A missing file goes unnoticed

When a link breaks or a file moves, the email still goes out. The visitor gets a message with nothing useful in it, and nobody is told.

Dynamic Attachments puts the file in the email itself. Pick it once for a notification, or let the page the form sits on supply it. If the file cannot be sent, the notification waits and the entry tells you why.

The Solution

Two switches on every notification

Open a notification and the Additional attachments section is at the end. Turn on either switch, or both. A file reached both ways is attached once.

1

Choose the files

Pick Media Library files, or upload private files in a Private files tab of the same media window. Any type your Media Library accepts can be sent.

2

Turn on a switch

Static attachments sends the same files with every send. Attach the files from the page the form was on sends the files in that page’s Email attachments box.

3

Every send is checked

The checks run on the final email, after Gravity Forms and other plugins have added their files. A notification is sent complete or not at all.

Everything runs on your own server through Gravity Forms’ usual sending. Your forms, entries and files are never sent to any outside service, and a notification you leave alone is not changed.

Key Features

Everything a notification needs to carry a file

Static files, the page’s own files and private files, all from one picker, with every send checked before it leaves.

Static attachments

Pick files once for a notification and every send carries them. Media Library files, private files or both, in the order you list them.

The files from the page

Each page, post or chosen custom post type gets an Email attachments box. Gravity Forms saves the page each entry came from, and the notification sends that page’s files.

Private files

Not in the Media Library and never shown by address. Each file sits alone in a folder with a long random name, and nothing links to it.

One picker, three tabs

Upload files, Media Library and Private files sit in the window WordPress already uses. Drop a file anywhere on it to upload a private file.

Held back, never sent short

If any file cannot be prepared, that notification is not sent. The entry, the confirmation and every other notification carry on as normal.

A reason on the entry

The entry gets a note naming the notification, why it was held back and how to fix it. The same reason goes to Gravity Forms logging.

Sent under its real name

A private file arrives under the name you uploaded, made safe for a server. The recipient never sees a random file name.

A 25 MiB ceiling

One email never carries more than 25 MiB of files, counted over every file in the final email. A developer can change it with a filter.

See It In Action

From the notification to the inbox

Every screen sits where you already work in WordPress and Gravity Forms. There is no separate dashboard to learn.

The Additional attachments section of a notification, with both switches on and two static files listed

Two switches on each notification

Static attachments lists the files every send carries, each with a preview and a Private or Media Library pill. The second switch sends the files of the page the form was on.

Private files, in the media window

The Private files tab sits beside Upload files and Media Library. Drop a file on the window to upload it. It goes into the plugin’s own store, not the Media Library, and no address is shown.

The Private files tab of the media window, with a drop zone and two private files as tiles
The Email attachments box in the block editor, with one Media Library file and two private files

Each page holds its own files

The Email attachments box sits in the block editor’s sidebar or the classic editor’s side column. Add as many files as you like. They are sent in the order listed.

Held back, with the reason

When a file cannot be prepared, the entry gets a note saying which notification was held back, why, and how to fix it. Every other notification on the entry still goes.

An entry note saying which notification was held back, why, and how to fix it

Set Up In Minutes

One settings tab, then a switch on each notification

Install Gravity Forms 2.5 or later, then this plugin. Use Gravity Forms 2.9 or later to send the files from the page. Under Forms, Settings, Additional attachments, tick the post types that show the Email attachments box. Posts and Pages are ticked to start with.

The Additional attachments tab under Forms, Settings, with the post types, the private files list and the uninstall switch

Forms, Settings, Additional attachments

The plugin’s tab holds its one setting, the post types that show the box. Below it, every private file is listed with where it is used, View and Delete. A switch decides whether private files go when the plugin is uninstalled.

FAQ

Questions, answered

Only Gravity Forms, 2.5 or later, and 2.9 or later for the files from the page. The Email attachments box is the plugin’s own, so no field plugin or theme feature is involved.

No address for a private file or its preview is ever published or shown. Each file sits in a folder with a long random name that the plugin never prints on a screen, in its log, in an entry note or in an email. Nothing links to it and the name is too long to guess. The protection is that the address is unknown, so it works the same on every host. Signed-in users who can upload files open private files with View, which goes through the plugin.

Its own name. The file is stored under the name you uploaded, made safe for a server, so Price list.pdf is stored as Price-list.pdf. On WordPress 6.2 and later the email carries the exact name you see in the list. Some mail plugins send the stored name instead.

From the Email attachments box on the page the form was sent from. Gravity Forms saves that page on every entry, on the server. The form has to be on the page itself. An archive or a preview has no page, so a notification that needs one is held back.

Any type your Media Library accepts. The plugin does not change what can be uploaded. Mail providers have their own rules, so test a new type with yours.

One email never carries more than 25 MiB of files, counted over every file before encoding, including files visitors upload and files other plugins attach. Many mail providers accept less, so keep attachments well under it. A developer can change the ceiling with the dagf_max_total_bytes filter.

While it is inactive it cannot hold a notification back, so Gravity Forms sends notifications without these files. Turn the affected notifications off or change them first. Your settings, page files and private files stay where they are.

Send the file with the form, every time.

Dynamic Attachments puts your own files on Gravity Forms notifications, from a fixed list or from the page the form was on, and holds a notification back before it can go out incomplete.

Free on WordPress.org. No account, no licence key. WordPress 6.0 or later, Gravity Forms 2.5 or later.