Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Email with attachement?

Started by Muut Archive 11 years ago · 6 replies · 931 views
11 years ago

I have got my contact form working using the google smtp as a server.

But now i want emails to be sent with an attachment.

i know there is a input file type to let users select fiels from there PC. but how to save upload them and them send it with the email?

Steffen

11 years ago

This has never been tried actually. The Email plugin is capable of handling attachments, but sending the file input added to a form as an attachment is something that must be taken care of, not yet implemented / tested.

Can you open an issue on the Email plugin so we don't lose track of it? https://github.com/getgrav/grav-plugin-email/issues

11 years ago

issue created.

i did look into the form tutorial. strainge thing is I enabled file upload. but it is not uploading the picture.. and it first need to upload pictures before i can send them as an attachement.

so basicly i need 2 things:

  1. upload a file
  2. find that file and send it with the email
11 years ago

1st thing fixed: i needed to add: enctype="multipart/form-data" into the the form.html.twig template. now the file is uploading properly

next step is to attach the file with the email ;-)

11 years ago

Yes that is already taken care by the default form.html.twig provided in the Form plugin. If your theme overrides it, you need to update it too.

11 years ago

i am not sure how to add an attachment with sending an email i thought some like this:
attachments: {{ @self.form.field.file }} but that is not working

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1351 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4062 9 years ago
Archive · by Muut Archive, 9 years ago
1 2948 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago