-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Describe the bug
Our client reported an issue that they have attached an asset to an email notification, but the attachment isn't sent with the email.
I found that Formie has a hardcoded limit for attachments at 15 mb:
// Check if the asset it over 15mb (a reasonable threshold)
if (($asset->size / 1000000) > 15) {
Formie::info('Not attaching “' . $asset->filename . '” due to large file size: ' . $asset->size . '.');
continue;
}Looks like the attachment is just silently dropped if the attachment is larger than the specified size.
I can understand the intention – a lot of email servers will reject emails with large attachment. However, the implementation needs some work.
Some suggestions:
- Make this limit configurable, so we can specify the maximum allowed attachment size.
- Enforce the limit (whether it's the current or the newly configurable limit) in the interface. If the selected asset is above the limit, prevent the notification from saving and show an actionable error message.
- Provide alternatives for large attachments – for example, have an option to just inject a link to the selected assets into the email?
Steps to reproduce
- In any form, open the Email Notifications tab and create a notification.
- In the notification, open the Advanced tab and select an asset with a size over 15 mb under Attach Assets.
Form settings
N/A
Craft CMS version
5.8.22
Plugin version
3.1.18
Multi-site?
No
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels