Hello to everybody,
I go through the forum and issues on github for over an hour to find a solution on how to send an attachment using the form.
- The visitor fills in the form and attaches a picture
- Sends it to the system
- I will receive an email with information + an attachment he has added
title: Reklamace
form:
name: reklamace
fields:
content:
type: section
title: 'Ověřovací informace'
underline: true
title_level: h4
classes: col-12
name:
label: 'Celé jméno'
type: text
autofocus: 'on'
validate:
required: true
autocomplete: 'on'
company:
label: Firma
type: text
validate: null
autocomplete: 'on'
email:
label: E-mail
type: email
validate:
required: true
rule: email
autocomplete: 'on'
phone:
label: Telefon
type: tel
validate:
required: true
autocomplete: 'on'
custom_file:
name: priloha
type: file
label: 'Vyberte fotku'
multiple: true
random_name: false
limit: 10
accept:
- 'image/*'
agree_to_terms:
type: checkbox
label: 'Accept'
validate:
required: true
g-recaptcha-response:
label: Captcha
type: captcha
recaptcha_not_validated: 'Neověřeno'
buttons:
submit:
type: submit
value: 'Send'
process:
captcha: true
save:
fileprefix: contact-
dateformat: Ymd-His-u
extension: txt
body: '{% include ''forms/data.txt.twig'' %}'
email:
to: **myEmail**
from: '{{ form.value.email|e }}'
subject: '[REKLAMACE] {{ form.value.email|e }}'
body: '{% include ''forms/data.html.twig'' %}'
attachments:
- priloha
message: 'E-mail sent'
display: odeslano
Body Mail looks:
Celé jméno : test
Firma : Name
E-mail : [mail](mailto:mail)
Telefon : Phone
Vyberte fotku :
* 20210818115146-eshop_cz.PNG
* image/png
* 100408
* upload_data_users/20210818115146-eshop_cz.PNG
Accept: Yes
I have everything set up and functional, but the attachment will be displayed in the email only as information where the uploaded file is located.
How do I attach it to an email as an attachment?
Thank you very much everyone, for their time.