Improved GhostMailer JSDocs

refs https://github.com/TryGhost/Team/issues/961

- The "from" parameter was not documented, so made it vary clear that it exists and is optional
This commit is contained in:
Naz 2021-08-12 13:58:13 +04:00
parent fa13ff2798
commit 41c70dfc96

View File

@ -37,6 +37,8 @@ function getFromAddress(requestedFromAddress) {
* Decorates incoming message object wit h nodemailer compatible fields.
* For nodemailer 0.7.1 reference see - https://github.com/nodemailer/nodemailer/tree/da2f1d278f91b4262e940c0b37638e7027184b1d#e-mail-message-fields
* @param {Object} message
* @param {boolean} [message.forceTextContent] - force text content
* @param {string} [message.from] - sender email address
* @returns {Object}
*/
function createMessage(message) {
@ -82,10 +84,11 @@ module.exports = class GhostMailer {
* @param {string} message.subject - email subject
* @param {string} message.html - email content
* @param {string} message.to - email recipient address
* @param {string} [message.from] - sender email address
* @param {boolean} [message.forceTextContent] - maps to generateTextFromHTML nodemailer option
* which is: "if set to true uses HTML to generate plain text body part from the HTML if the text is not defined"
* (ref: https://github.com/nodemailer/nodemailer/tree/da2f1d278f91b4262e940c0b37638e7027184b1d#e-mail-message-fields)
* @returns {Promise}
* @returns {Promise<any>}
*/
async send(message) {
if (!(message && message.subject && message.html && message.to)) {