File upload fields and Attachments emailed as url links to private files folder
Thank-you very much for an amazing module and amazing documentation.
I am using the following:
Drupal core 9.4.10
Entity Print 8.x-2.6
Webform 6.1.4
Webform Attachment 6.1.4
Webform Entity Print (PDF) Attachment 6.1.4
I have both File Upload fields and an Attachment field on my webform. In the email handler for my form, I have checked the file upload fields and the attachment field to be included in the submission values. "Include files as attachments" is enabled.
The email gets sent, but the email contains links to all files rather than the files as an attachment. If I "Disable saving of submissions" there is no record of the file uploads or attachments to access. If I choose to exclude a field from submissions, it is ignored and still displayed.
My webform settings:
langcode: en
status: open
dependencies:
module:
- honeypot
- webform_entity_print
third_party_settings:
webform_entity_print:
template:
header: ''
footer: ''
css: ''
export_types:
pdf:
enabled: true
link_text: ''
link_attributes: { }
honeypot:
honeypot: true
weight: 0
open: null
close: null
uid: 1
template: false
archive: false
id: payment_request
title: 'Payment Request'
description: 'Form for Scholars to request payment.'
category: ''
elements: |-
supporting_documentation:
'#type': webform_section
'#title': 'Supporting Documentation'
supporting_text:
'#type': webform_markup
'#markup': '<h4>Please visit the <a href="/payment-forms" target="_blank">Payment Request Forms and Guidance</a> page <em>before</em> filling out this form.</h4>'
supporting_documentation_flex:
'#type': webform_flexbox
transcript:
'#type': webform_document_file
'#title': 'Proof of Enrollment'
'#help_title': "Proof of enrollment\_showing you are enrolled and in good standing at your institution."
'#help': |-
<ul>
<li>An <em>unofficial</em> transcript <em>is acceptable, </em>or a receipt of deposit, or enrollment form. </li>
<li>Proof of Enrollment is required the first time you request payment each Academic Year.</li>
</ul>
<p><em><a href="/payment-forms#poe" target="_blank">Read more ></a></em></p>
'#flex': 0
'#max_filesize': '1'
eefs_form:
'#type': webform_document_file
'#title': 'Educational Expenses and Support Form (EESF)'
'#help': |-
<ul>
<li>Complete Part I of the Educational Expenses and Support Form;</li>
<li>Give the Educational Expenses and Support Form to your Financial Aid Officer who should complete Part II.</li>
<li>You may use the same form for fall and spring study, if your expenses and aid stay the same. However, you will need a separate form for summer study. Special programs must be approved by the Executive Secretary.</li>
</ul>
<em><a href="/payment-forms#eesf" target="_blank">Read more ></a></em>
'#flex': 0
'#max_filesize': '1'
'#file_extensions': pdf
direct_deposit_eft_enrollment_change_form:
'#type': webform_document_file
'#title': 'Electronic Funds Transfer (EFT) Form'
'#help_title': 'Direct Deposit'
'#help': |-
<br />
You must submit an EFT form if any of the following is true.
<ul>
<li>You have not ever submitted one; or</li>
<li>You have not received a payment in the last 12 months; or</li>
<li>Your bank account information has changed since you submitted your last EFT form.</li>
</ul>
<a href="/payment-forms#eft" target="_blank"><em>Read more ></em></a>
'#flex': 0
'#max_filesize': '1'
'#file_extensions': pdf
other_supporting_documents:
'#type': webform_document_file
'#title': 'Other Supporting Documents'
'#multiple': true
'#flex': 0
'#max_filesize': '1'
personal_information:
'#type': webform_section
'#title': 'Scholar''s Personal Information'
personal_information_flexbox:
'#type': webform_flexbox
name:
'#type': textfield
'#title': Name
'#autocomplete': ''
'#required': true
'#required_error': 'Please enter the Scholar''s name.'
'#flex': 0
email:
'#type': email
'#title': Email
'#required': true
'#required_error': 'Please enter the Scholar''s email address.'
'#flex': 0
phone:
'#type': textfield
'#title': Phone
'#placeholder': '(123) 456-7890'
'#autocomplete': ''
'#input_mask': '(999) 999-9999'
'#required': true
'#required_error': 'Please enter the Scholar''s phone number in the form of (123) 456-7890'
'#flex': 0
year_elected:
'#type': datelist
'#title': 'Year Selected'
'#required': true
'#required_error': 'Please enter the year the Scholar was selected.'
'#date_max': '+1 year'
'#flex': 0
'#date_date_max': '+1 year'
'#date_part_order':
- year
'#date_year_range': '2015:2035'
financial_aid_and_expenses:
'#type': webform_section
'#title': 'Financial Aid and Expenses'
financial_aid_examples:
'#type': webform_markup
'#markup': 'Examples of eligible financial aid you receive for <strong>this term might </strong>include scholarships, grants, tuition and fee waivers, fellowships, Pell Grants, work-study programs, and all other need-based or merit-based assistance. Do not include aid from the Truman Foundation, your own earnings or savings, loans, support from your family, or support from the Department of Veteran Affairs.'
other_financial_aid:
'#type': checkbox
'#title': 'I will NOT receive any eligible financial aid for this term other than from the Truman Foundation.'
financial_aid:
'#type': webform_custom_composite
'#title': 'Other Financial Aid'
'#title_display': invisible
'#states':
visible:
':input[name="other_financial_aid"]':
unchecked: true
'#multiple__sorting': false
'#multiple__add_more': false
'#element':
sources:
'#type': textfield
'#title': 'Other Sources of Aid for this Term'
'#placeholder': 'Other Sources of Aid for this Term'
purpose:
'#type': textfield
'#title': 'Purpose(s) of this Aid'
'#placeholder': 'Purpose(s) of this Aid'
'#description': 'Examples: Tuition, Room and Board, Fees, Undesignated'
'#help': 'If the Purpose(s) of the Aid is designated, specify for tuition, fees, room and board, books, etc. If the source does not specify how the support is to be used, enter "undesignated". Loans are non-deductible.'
aid_amount:
'#type': textfield
'#title': Amount
'#placeholder': Amount
expenses_for_this_term:
'#type': webform_section
'#title': 'Expenses for this term'
tuition:
'#type': number
'#title': Tuition
'#placeholder': '0.00'
'#autocomplete': ''
'#default_value': '0.00'
'#min': 0
fees:
'#type': number
'#title': Fees
'#autocomplete': ''
'#default_value': '0.00'
'#min': 0
books:
'#type': number
'#title': Books
'#autocomplete': ''
'#default_value': '0.00'
'#min': 0
room_and_board:
'#type': number
'#title': 'Room and Board'
'#autocomplete': ''
'#default_value': '0.00'
'#min': 0
total_above_four_items:
'#type': webform_computed_twig
'#title': 'Total ( Above Four Items )'
'#template': |-
{% if data.fees|length and data.tuition|length and data.books|length and data.room_and_board|length %}
<h4>{{(( data.fees + data.tuition + data.books + data.room_and_board ))|number_format(2) }}</h4>
{% endif %}
'#ajax': true
additional_expenses:
'#type': number
'#title': 'Additional Expenses'
'#placeholder': '0.00'
'#min': 0
payment_determination:
'#type': webform_section
'#title': 'Payment Determination'
total_allowable_expenses:
'#type': number
'#title': 'Total allowable expenses'
'#default_value': '0.00'
'#min': 0
total_deductible_support:
'#type': number
'#title': 'Total deductible support'
'#default_value': '0.00'
'#min': 0
expenses_eligible_for_payment:
'#type': number
'#title': 'Expenses eligible for payment'
'#default_value': '0.00'
'#min': 0
maximum_annual_payment_amount_determined_on_graduate_study_appro:
'#type': number
'#title': 'Maximum annual payment ( Amount determined on Graduate Study Approval )'
'#default_value': '0.00'
'#min': 0
previous_payments_this_academic_year:
'#type': number
'#title': 'Previous payments this academic year'
'#default_value': '0.00'
'#min': 0
payment_request:
'#type': number
'#title': 'Payment request'
'#required': true
'#required_error': 'Please enter the amount of payment requested.'
'#default_value': '0.00'
'#min': 0
payment_information:
'#type': webform_section
'#title': 'Payment Information'
institution:
'#type': textfield
'#title': Institution
'#required': true
'#required_error': 'Please enter the Institution the Scholar attends.'
institution_operates_on:
'#type': webform_radios_other
'#title': 'Institution operates on'
'#options':
quarters: Quarters
semesters: Semesters
trimesters: Trimesters
'#required': true
'#required_error': 'Please select the type of terms the Scholar''s institution operates on.'
term:
'#type': radios
'#title': Term
'#options':
summer: Summer
fall: Fall
winter: Winter
spring: Spring
'#required': true
tuition_and_fees_due_date:
'#type': date
'#title': 'Tuition and Fees Due Date'
'#required': true
'#required_error': 'Please slect the date the Scholar''s tuition and fees are due for payment.'
'#date_date_min': now
academic_year:
'#type': select
'#title': 'Academic Year'
'#help': 'The academic year for which payment is requested.'
'#options':
'2023_2024': 2023-2024
'2024_2025': 2024-2025
'2025_2026': 2025-2026
'2026_2027': 2026-2027
'2027_2028': 2027-2028
'2028_2029': 2028-2029
'2029_2030': 2029-2030
'2030_2031': 2030-2031
'2031_2032': 2031-2032
'2032_2033': 2032-2033
'2033_2034': 2033-2034
'2034_2035': 2034-2035
'#required': true
'#required_error': 'Please enter the academic year for which payment is requested.'
payment_number_this_year:
'#type': textfield
'#title': 'Payment Number for this Academic Year'
'#autocomplete': ''
'#input_mask': '9 of 9'
'#required': true
certification_and_submission:
'#type': webform_section
'#title': 'Certification and Submission'
certification_text:
'#type': webform_markup
'#markup': 'I certify that the financial aid reported are true amounts paid for THIS TERM on my behalf by other organizations, and any differences in payments will be reported immediately to the Truman Scholarship Foundation. I agree to refund the payment to the Truman Scholarship Foundation if I withdraw from school before the end of the term. I certify that the expenses reported for THIS TERM are correct, and funds received will be utilized for the purposes specified in accordance with the provisions of the Truman Scholarship. I reaffirm my commitment to a career in public service defined as employment in: government, the uniformed services, public interest organizations, non-governmental research and/or educational institutions and non-profit organizations.'
signature_of_truman_scholar:
'#type': webform_signature
'#title': 'Signature of Truman Scholar'
'#description': ''
'#required': true
'#required_error': 'Please sign your name before submitting.'
'#uri_scheme': private
date_signed:
'#type': date
'#title': Date
'#required': true
'#date_min': ''
'#date_max': ''
'#date_date_min': '-1 day'
'#date_date_max': '+1 day'
'#date_part_order':
- year
- month
- day
'#date_year_range': '2023:2035'
payment_request_attachment:
'#type': 'webform_entity_print_attachment:pdf'
'#title': 'Payment Request Attachment'
'#display_on': both
'#filename': payment-request-form.pdf
'#link_title': 'Payment Request'
'#download': true
css: ''
javascript: ''
settings:
ajax: false
ajax_scroll_top: form
ajax_progress_type: ''
ajax_effect: ''
ajax_speed: null
page: true
page_submit_path: /payment_request_form
page_confirm_path: ''
page_theme_name: ''
form_title: source_entity_webform
form_submit_once: false
form_open_message: ''
form_close_message: ''
form_exception_message: ''
form_previous_submissions: false
form_confidential: false
form_confidential_message: ''
form_disable_remote_addr: false
form_convert_anonymous: false
form_prepopulate: false
form_prepopulate_source_entity: false
form_prepopulate_source_entity_required: false
form_prepopulate_source_entity_type: ''
form_unsaved: false
form_disable_back: false
form_submit_back: false
form_disable_autocomplete: false
form_novalidate: false
form_disable_inline_errors: false
form_required: false
form_autofocus: false
form_details_toggle: false
form_reset: false
form_access_denied: login
form_access_denied_title: ''
form_access_denied_message: 'Please login to submit a request for payment.'
form_access_denied_attributes: { }
form_file_limit: ''
form_attributes: { }
form_method: ''
form_action: ''
share: false
share_node: false
share_theme_name: ''
share_title: true
share_page_body_attributes: { }
submission_label: ''
submission_exception_message: ''
submission_locked_message: ''
submission_log: false
submission_excluded_elements:
direct_deposit_eft_enrollment_change_form: direct_deposit_eft_enrollment_change_form
submission_exclude_empty: false
submission_exclude_empty_checkbox: false
submission_views: { }
submission_views_replace: { }
submission_user_columns: { }
submission_user_duplicate: false
submission_access_denied: default
submission_access_denied_title: ''
submission_access_denied_message: ''
submission_access_denied_attributes: { }
previous_submission_message: ''
previous_submissions_message: ''
autofill: true
autofill_message: ''
autofill_excluded_elements:
transcript: transcript
eefs_form: eefs_form
direct_deposit_eft_enrollment_change_form: direct_deposit_eft_enrollment_change_form
other_supporting_documents: other_supporting_documents
other_financial_aid: other_financial_aid
financial_aid: financial_aid
financial_aid__sources: financial_aid__sources
financial_aid__purpose: financial_aid__purpose
financial_aid__aid_amount: financial_aid__aid_amount
tuition: tuition
fees: fees
books: books
room_and_board: room_and_board
total_above_four_items: total_above_four_items
additional_expenses: additional_expenses
total_allowable_expenses: total_allowable_expenses
total_deductible_support: total_deductible_support
expenses_eligible_for_payment: expenses_eligible_for_payment
maximum_annual_payment_amount_determined_on_graduate_study_appro: maximum_annual_payment_amount_determined_on_graduate_study_appro
previous_payments_this_academic_year: previous_payments_this_academic_year
payment_request: payment_request
institution: institution
institution_operates_on: institution_operates_on
term: term
tuition_and_fees_due_date: tuition_and_fees_due_date
academic_year: academic_year
payment_number_this_year: payment_number_this_year
signature_of_truman_scholar: signature_of_truman_scholar
date_signed: date_signed
payment_request_attachment: payment_request_attachment
wizard_progress_bar: true
wizard_progress_pages: false
wizard_progress_percentage: false
wizard_progress_link: false
wizard_progress_states: false
wizard_start_label: ''
wizard_preview_link: false
wizard_confirmation: true
wizard_confirmation_label: ''
wizard_auto_forward: true
wizard_auto_forward_hide_next_button: false
wizard_keyboard: true
wizard_track: ''
wizard_prev_button_label: ''
wizard_next_button_label: ''
wizard_toggle: false
wizard_toggle_show_label: ''
wizard_toggle_hide_label: ''
wizard_page_type: container
wizard_page_title_tag: h2
preview: 0
preview_label: ''
preview_title: ''
preview_message: ''
preview_attributes: { }
preview_excluded_elements: { }
preview_exclude_empty: true
preview_exclude_empty_checkbox: false
draft: none
draft_multiple: false
draft_auto_save: false
draft_saved_message: ''
draft_loaded_message: ''
draft_pending_single_message: ''
draft_pending_multiple_message: ''
confirmation_type: url
confirmation_url: /payment-request-confirmation
confirmation_title: 'Payment Request Submitted'
confirmation_message: 'Your request has been successfully submitted. Please allow 6 to 8 weeks for processing. If you do not have your funds after 8 weeks, please contact office@truman.gov.'
confirmation_attributes: { }
confirmation_back: true
confirmation_back_label: ''
confirmation_back_attributes: { }
confirmation_exclude_query: false
confirmation_exclude_token: false
confirmation_update: false
limit_total: null
limit_total_interval: null
limit_total_message: ''
limit_total_unique: false
limit_user: null
limit_user_interval: null
limit_user_message: ''
limit_user_unique: false
entity_limit_total: null
entity_limit_total_interval: null
entity_limit_user: null
entity_limit_user_interval: null
purge: all
purge_days: 2
results_disabled: false
results_disabled_ignore: false
results_customize: false
token_view: false
token_update: false
token_delete: false
serial_disabled: false
access:
create:
roles:
- administrator
- scholar
users: { }
permissions: { }
view_any:
roles:
- administrator
users: { }
permissions: { }
update_any:
roles:
- administrator
users: { }
permissions: { }
delete_any:
roles:
- administrator
users: { }
permissions: { }
purge_any:
roles:
- administrator
users: { }
permissions: { }
view_own:
roles:
- administrator
users: { }
permissions: { }
update_own:
roles:
- administrator
users: { }
permissions: { }
delete_own:
roles:
- administrator
users: { }
permissions: { }
administer:
roles:
- administrator
users: { }
permissions: { }
test:
roles:
- administrator
users: { }
permissions: { }
configuration:
roles: { }
users: { }
permissions: { }
handlers:
email:
id: email
handler_id: email
label: Email
notes: ''
status: true
conditions: { }
weight: 0
settings:
states:
- completed
to_mail: office@truman.gov
to_options: { }
bcc_mail: ''
bcc_options: { }
cc_mail: ''
cc_options: { }
from_mail: _default
from_options: { }
from_name: _default
reply_to: ''
return_path: ''
sender_mail: ''
sender_name: ''
subject: _default
body: "<h2>Payment Request Form submission values:</h2>\r\n[webform_submission:values]"
excluded_elements: { }
ignore_access: false
exclude_empty: true
exclude_empty_checkbox: false
exclude_attachments: false
html: true
attachments: true
twig: false
theme_name: ''
parameters: { }
debug: false
variants: { }