sweets-marzipan
v0.11.0
Published
Downloads
27
Maintainers
Readme
Sweets
Flexible declarative web framework for real-time projects
Marzipan
Dummy resource that has only controller. If you need api for sending emails your should override request
and api
units.
Settings
this.mail = {
defauts: {},
transport: {}
};
defaults
are the same options as below in the send method. defaults
will be applied to all messages.
For transport ([https://github.com/andris9/Nodemailer](see nodemailer for details))
Usage
Mail resource controller has one method:
####send(options, cb)
The following are the possible options:
- from - The e-mail address of the sender. All e-mail addresses can be plain '[email protected]' or formatted 'Sender Name [email protected]', see here for details
- sender - An e-mail address that will appear on the Sender: field
- to - Comma separated list or an array of recipients e-mail addresses that will appear on the To: field
- cc - Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field
- bcc - Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field
- subject - The subject of the e-mail
- text - The plaintext version of the message as an Unicode string, Buffer, Stream or an object {path: '...'}
- template - template name that will be rendered with default template environment.
- data - data object that will be passed to template.
- attachments - An array of attachment objects ([https://github.com/andris9/Nodemailer#attachments](see nodemailer for details))
- alternatives - An array of alternative text contents (in addition to text and html parts) ([https://github.com/andris9/Nodemailer#alternatives](see nodemailer for details))
- envelope - optional SMTP envelope, if auto generated envelope is not suitable ([https://github.com/andris9/Nodemailer#smtp-envelope](see nodemailer for details))
- messageId - optional Message-Id value, random value will be generated if not set
- encoding - optional transfer encoding for the textual parts All text fields (e-mail addresses, plaintext body, html body) use UTF-8 as the encoding. Attachments are streamed as binary.
License
MIT License