How to send plain text emails?
Total.js supports F.logmail()
method for sending simple emails without having to define HTML template. Each email body is wrapped into the <pre>
tag, so the email body looks a bit like plain text email.
var builder = [];
builder.push('Hello Peter,');
builder.push('- this is a simple plain text email');
builder.push('- we can use basic HTML tags like B, I, STRONG, EM and A');
builder.push('- new line is really new line');
F.logmail('petersirka@gmail.com', 'Plain text email', builder.join('\n'));
How to add an attachments?
var builder = [];
builder.push('Hello Peter');
builder.push('here is the price list.');
var message = F.logmail('petersirka@gmail.com', 'Plain text email', builder.join('\n'));
message.attachment(F.path.public('pricelist.pdf'), 'pricelist.pdf');
// message = https://docs.totaljs.com/latest/en.html#api~FrameworkMail
Documentation