mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Fixed bug when checking email batch size
- even though we don't do anything yet, the code was calling `.length` on an object, which is `undefined` - this fixes that by checking the length of the keys - also moves the code block down so we can early-return if mailgun is not configured
This commit is contained in:
parent
5d177c2a11
commit
ddbee90c1c
@ -31,16 +31,16 @@ module.exports = class MailgunClient {
|
||||
* }
|
||||
*/
|
||||
send(message, recipientData, replacements) {
|
||||
if (recipientData.length > module.exports.BATCH_SIZE) {
|
||||
// err - too many recipients
|
||||
}
|
||||
|
||||
const mailgunInstance = this.getInstance();
|
||||
if (!mailgunInstance) {
|
||||
logging.warn(`Mailgun is not configured`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object.keys(recipientData).length > module.exports.BATCH_SIZE) {
|
||||
// TODO: what to do here?
|
||||
}
|
||||
|
||||
let messageData = {};
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user