You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of the module is the issue happening on? Does the issue happen on latest version?
yes
What platform and Node.js version? (For example Node.js 6.9.1 on Mac OS X)
Node 12.6.0 on Windows 10
I am totally stumped by an error I am receiving while sending an attachment. I have a function I run after generating a csv file from a number of API calls which sends that file as an attachment.
The function is simple, just takes the attachment filepath and text of the message
constsendEmail=(attachment,text)=>{letdata={
from,
to,
subject,
text,
attachment
}mailgun.messages().send(data,(error,body)=>{if(error){console.log(error);}else{console.log(body);console.log('email sent')}});}
When this function runs I have an error
Error: 'from' parameter is missing
at IncomingMessage. (C:\Users\jwils\Code\sycle-reporting\node_modules\mailgun-js\lib\request.js:327:17)
at IncomingMessage.emit (events.js:208:15)
at endReadableNT (_stream_readable.js:1154:12)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
statusCode: 400
}
I am defining the from value in another variable, and the function works perfectly fine without an attachment. Once I try and send this file I receive the 'from" parameter missing, even though that isn't a missing parameter.
I have been able to send a file with this function under different circumstances, but when I do get this error there is no way of identifying the actual cause from the error message.
Are there any insights into sending csv files? I tried using the mailgun.Attachment class with no success either. I am totally stumped, and don't know where to move from here.
I have been able to send a blank .txt file, but the csv's seem to fail.
I appreciate any information into this specific error message.
Thank you,
Julian
The text was updated successfully, but these errors were encountered:
I determined the error is actually that the attachment file did not exist at the time of the email sending. I had a race condition in my csv generation which caused the email to fail to send as the attachment was still writing to disk when it tried to send the email.
Ideally this error message would mention the actual missing parameter.
yes
Node 12.6.0 on Windows 10
I am totally stumped by an error I am receiving while sending an attachment. I have a function I run after generating a csv file from a number of API calls which sends that file as an attachment.
The function is simple, just takes the attachment filepath and text of the message
When this function runs I have an error
Error: 'from' parameter is missing
at IncomingMessage. (C:\Users\jwils\Code\sycle-reporting\node_modules\mailgun-js\lib\request.js:327:17)
at IncomingMessage.emit (events.js:208:15)
at endReadableNT (_stream_readable.js:1154:12)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
statusCode: 400
}
I am defining the from value in another variable, and the function works perfectly fine without an attachment. Once I try and send this file I receive the 'from" parameter missing, even though that isn't a missing parameter.
I have been able to send a file with this function under different circumstances, but when I do get this error there is no way of identifying the actual cause from the error message.
Are there any insights into sending csv files? I tried using the mailgun.Attachment class with no success either. I am totally stumped, and don't know where to move from here.
I have been able to send a blank .txt file, but the csv's seem to fail.
I appreciate any information into this specific error message.
Thank you,
Julian
The text was updated successfully, but these errors were encountered: