Can I attach files submitted through a form to notification e-mails?
Direct file attachment to notification e-mails is not supported due to file size limitations and spam filter concerns.
However, you can include a download link in the notification e-mail as an alternative.
How to set up
Message template
Add the download URL and the file name to the notification e-mail message template.
| Module | Identifier |
|---|---|
| Form | inquiry/inquiry_contact |
Example:
File download URL:
{$smarty.const.ROOT_MNG_URL}/direct/inquiry/file_download/?file_nm={$inquiry_bn_id}_ext_01
- The file extension is not assigned to the message template variable. It is automatically appended when the file is downloaded, so you do not need to include it in the URL.
- Note: If you are using S3/GCS storage, you need to include the file extension in the URL.
If you do not want to keep attached files in Kuroco
You can set up a batch process to automatically delete form responses that are older than a certain period (e.g., one week).
Prerequisites: Creating endpoints
Create an InquiryMessage::list endpoint and an InquiryMessage::delete endpoint in your internal API.
Batch process
Create a batch process using the following code.
{* Fetch responses older than 7 days *}
{assign var='queries' value=$dataSet.emptyArray}
{append var='queries' index='filter' value='inst_ymdhi <:relatively "7 days ago"'}
{append var='queries' index='cnt' value='0'}
{api_internal
var='response'
status_var='status'
endpoint='/rcms-api/1/inquiry-list'
method='GET'
member_id='1'
queries=$queries
}
{* Delete each response *}
{foreach from=$response.list item=item}
{assign var='target' value="/rcms-api/1/inquiry-delete/`$item.inquiry_bn_id`"}
{api_internal
var='del_response'
status_var='del_status'
endpoint=$target
method='POST'
member_id='1'
}
{logger msg1="Deleted inquiry_bn_id=`$item.inquiry_bn_id`" msg2=$del_response}
{/foreach}
Replace /rcms-api/1/inquiry-list and /rcms-api/1/inquiry-delete/ with your actual endpoint paths.
More information
For more information on customizing e-mail notifications, see:
Support
If you have any other questions, please contact us or check out Our Slack Community.