DMXzone Mailer Support Product Page

Solved

Can't send attachment with the email from a form

Reported 11 Oct 2018 10:23:46
1
has this problem
11 Oct 2018 10:23:46 Bruce Wilkie posted:
Hi there

Enquiry form working fine until I specify an attachment.
Once I do that nothing happens when I click on the submit button

Any ideas what I'm doing wrong?

Bruce

Replies

Replied 11 Oct 2018 10:42:00
11 Oct 2018 10:42:00 Teodor Kuduschiev replied:
Replied 11 Oct 2018 10:48:24
11 Oct 2018 10:48:24 Bruce Wilkie replied:
Hi Teodor

Thanks for the suggestion. Tried but didn't help I'm afraid.

Nothing appearing under console when I refresh the page and retry with console open.

You can check it at 151.252.3.12/~qowgvzsp/form-test-attachment-1.php

Bruce
Replied 11 Oct 2018 11:21:40
11 Oct 2018 11:21:40 Bruce Wilkie replied:
Am I adding the attachment right?

I can't see any mention of attachments in the manual, even though it states in the plugin salees page that we can attach files.

Is there a video or a guide somewhere that shows us how to include attachments with DMXZone Mailer? It could be that I'm just clicking on the wrong thing
Replied 11 Oct 2018 11:36:19
11 Oct 2018 11:36:19 Teodor Kuduschiev replied:
Well it does appear actually ... and as described in the video i sent you must enable the DEBUG option in server connect:
prnt.sc/l4tqe7
Replied 11 Oct 2018 11:52:24
11 Oct 2018 11:52:24 Bruce Wilkie replied:
Hi Teodor

Thanks for the screenshot
There was no error in the console window when the video said there would be. That's where I got lost there.

prntscr.com/l4tvi9

Following your screenshot I've tunnelled down to Network > XHR and I'm seeing this now:

prntscr.com/l4ty81

Hope this helps you. Am I doing it right?

Bruce
Replied 11 Oct 2018 11:53:13
11 Oct 2018 11:53:13 Teodor Kuduschiev replied:
I see the error says wrong path. What is selected in the email attachment settings for the file?
Replied 11 Oct 2018 12:05:02
11 Oct 2018 12:05:02 Bruce Wilkie replied:
Thanks Teodor.
I don't see an error saying wrong path when i view it, but I do see two lines with '500' with a red background next to them. Is that the code for wrong path?

Either way, I just selected the file field in the form for the email attachment

prntscr.com/l4u3ei

Hope this helps

Bruce
Replied 11 Oct 2018 12:10:02
11 Oct 2018 12:10:02 Teodor Kuduschiev replied:
I am not sure how familiar you are with the Dev tools, but you should click the server action with error and you see the error: prntscr.com/l4u751

The expression selected in the server action is absolutely wrong. You need a file upload step, and after that you use the url returned from the file upload step to bind in the attachment field.
You cannot just get the file from the POST variable like that ... file field itself is not uploading the file, you always need an upload step and use the results from it.
Replied 11 Oct 2018 12:31:40
11 Oct 2018 12:31:40 Bruce Wilkie replied:
Sorry, not very familiar with Dev tools. Usually just use them for tracing CSS issues.

Thanks for letting me know about the file upload. Is there a video showing how to integrate it with Mailer?
Or if not can you link a video that it features in so I can try to work it out?

thanks
Bruce


Replied 11 Oct 2018 12:40:49
11 Oct 2018 12:40:49 Teodor Kuduschiev replied:
There is no video tutorial.
All you need to is to add upload step before the mailer. Then use the output of the upload step in the attachment field - nothing too special.
Replied 11 Oct 2018 12:48:29
11 Oct 2018 12:48:29 Bruce Wilkie replied:
OK, will give it a go.

Thanks for finding the problem for me Teodor

Bruce
Replied 11 Oct 2018 13:21:12
11 Oct 2018 13:21:12 Bruce Wilkie replied:
Hi Teodor

Thanks for the pointer. File now uploading, sending and deleting from server after sent

The only problem I can find now is if no file is selected to attach by the form's user.

Is there a simple way to tell the form to attach a file to the email if one has been uploaded, but to ignore the attachment if no file was uploaded?

Basically on the form I'm working on, users have the option to attach a file if they want, but it's not compulsory.

Bruce
Replied 11 Oct 2018 13:29:03
11 Oct 2018 13:29:03 Teodor Kuduschiev replied:
You should add a condition then in server connect.

Steps:
> file upload
> condition - use {{$_POST.attachment1}} as a value
>> then > send mail step with attachment
>> else > send mail step without attachment
Replied 11 Oct 2018 13:35:56
11 Oct 2018 13:35:56 Bruce Wilkie replied:
Perfect

All working exactly as intended now. Thanks so much for your help as always Teodor

Reply to this topic