Похоже, что электронная почта метеора требует, чтобы вы добавили attachments
ключи, которые должны быть массивом вложений.
Что касается параметров для вложений - существует несколько :
{ // utf-8 string as an attachment
filename: 'text1.txt',
content: 'hello world!'
},
{ // binary buffer as an attachment
filename: 'text2.txt',
content: new Buffer('hello world!','utf-8')
},
{ // file on disk as an attachment
filename: 'text3.txt',
path: '/path/to/file.txt' // stream this file
},
{ // filename and content type is derived from path
path: '/path/to/file.txt'
},
{ // stream as an attachment
filename: 'text4.txt',
content: fs.createReadStream('file.txt')
},
{ // define custom content type for the attachment
filename: 'text.bin',
content: 'hello world!',
contentType: 'text/plain'
},
{ // use URL as an attachment
filename: 'license.txt',
path: 'https://raw.github.com/andris9/Nodemailer/master/LICENSE'
},
{ // encoded string as an attachment
filename: 'text1.txt',
content: 'aGVsbG8gd29ybGQh',
encoding: 'base64'
},
{ // data uri as an attachment
path: 'data:text/plain;base64,aGVsbG8gd29ybGQ='
}
Конкретно в вашем примере вы можете использовать:
const base64AttachmentString = 'data:application/pdf;base64,' + generatePdfBase64();
import { Email } from "meteor/email";
Email.send({
to: "email@example.com",
from: "John Smith <johnsmith@example.com>",
subject: "Sending Base64 as PDF",
html: generatedHTMLTemplate,
attachments: [
{
path: base64AttachmentString
}
]
});