이 Meteor 서버 코드는 pdf 파일을 첨부하려고 시도하지만 서버 시작시 오류가 발생합니다. 먼저 파일을 로컬에 저장하지 마십시오. 그것은 pascoual : pdfkit을 사용하고 있습니다. mailcomposer documentation에meteor에있는 이메일에 pdf를 첨부하십시오.
이Error: Message failed: 421 Timeout waiting for data from client.
유성 문서 포인트,하지만 문제는 첨부 파일에서 PDF의 문서를 통합하는 방법입니다 :
나는 점점 오전 오류입니다. 어떤 아이디어? 나는 Invoice.make()
이 덩어리의 형식을 기대 반환하지 않습니다 잘못 아니에요 경우 덕분에 문서 당으로
Meteor.startup(() => {
Invoice.email();
};
// invoice.js
use strict";
let PDFDocument = require ('pdfkit');
let metaData = {
'Title': 'Invoice',
'Author': 'myName',
};
export const Invoice = {
'make': function() {
let doc = new PDFDocument(metaData);
doc.text('my company').text('company number');
return doc;
},
'email': function() {
let inv = Invoice.make();
Email.send({
to: '[email protected]',
from: '[email protected]',
subject: 'Invoice',
text: ' Please see the attached invoice',
attachments: {
filename: 'invoice.pdf',
content: inv // <=== this is the issue
});
}
};