Page 1 of 1

email with attachment

Posted: Wed Sep 05, 2018 3:30 am
by amit
Hello,

nuBuilder is great, thanks to the developer(s)!

I'm developing a web application that allows to send emails to customers. There's a also possibility to pick a document which will be sent along. This works fine so far. Now I've encountered a strange problem: The attachment was sent the first time. The next time, however, the attachment did not come along. I'm at a real loss. What could be the reason?

Re: email with attachment

Posted: Wed Sep 05, 2018 8:30 pm
by amit
Hi again,

Some additional information: The documents to be attached to the email are stored on the server. (like file1.pdf, file2.pdf, file3.pdf ...)
After some further investigations I found the file no longer exists on the server after the first email has been sent using nuSendEmail function.
How to prevent this from happening? The function is not supposed to wipe documents on the server.

Re: email with attachment

Posted: Sat Sep 22, 2018 4:15 am
by toms
Amit,

This is how the function works :(

A function should do exactly what is suggested by its name, no more.

Here's the link to the old topic and a kind of fix:

https://forums.nubuilder.cloud/viewtopic. ... ink#p16108

My suggestion to change the function remained uncommented.
Well... even though I have a solution, maybe you can consider my suggestion to change the behaviour of nuSendEmail()-
(Or to add a parameter like "delete_source_files_after_sending" with true --> unlink() and false --> don't delete the source files )