Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap-cloud-sdk/mail-client

Package Overview
Dependencies
Maintainers
0
Versions
734
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-cloud-sdk/mail-client - npm Package Compare versions

Comparing version 3.22.3-20241114014128.0 to 3.22.3-20241114134823.0

51

dist/mail-client.js

@@ -128,9 +128,18 @@ "use strict";

const response = [];
for (const mailConfigIndex in mailConfigs) {
logger.debug(`Sending email ${mailConfigIndex + 1}/${mailConfigs.length}...`);
response[mailConfigIndex] = await transport.sendMail({
...mailConfigsFromDestination,
...mailConfigs[mailConfigIndex]
});
logger.debug(`...email ${mailConfigIndex + 1}/${mailConfigs.length} for subject "${mailConfigs[mailConfigIndex].subject}" was sent successfully.`);
for (const [mailConfigIndex, mailConfig] of mailConfigs.entries()) {
try {
logger.debug(`Sending email ${mailConfigIndex + 1}/${mailConfigs.length}...`);
response[mailConfigIndex] = await transport.sendMail({
...mailConfigsFromDestination,
...mailConfig
});
logger.debug(`...email ${mailConfigIndex + 1}/${mailConfigs.length} with subject "${mailConfig.subject}" was sent successfully.`);
}
catch (error) {
logger.error(`Failed to send email ${mailConfigIndex + 1}/${mailConfigs.length} with subject "${mailConfig.subject}". Error: ${error.message}`);
response[mailConfigIndex] = {
response: error.response,
rejected: error.rejected
};
}
}

@@ -140,13 +149,21 @@ return response;

async function sendMailInParallel(transport, mailConfigsFromDestination, mailConfigs) {
const promises = mailConfigs.map((mailConfig, mailConfigIndex, mailConfigsArray) => {
logger.debug(`Sending email ${mailConfigIndex + 1}/${mailConfigsArray.length}...`);
return transport.sendMail({
...mailConfigsFromDestination,
...mailConfig
});
const promises = mailConfigs.map(async (mailConfig, mailConfigIndex, mailConfigsArray) => {
try {
logger.debug(`Sending email ${mailConfigIndex + 1}/${mailConfigsArray.length}...`);
const response = await transport.sendMail({
...mailConfigsFromDestination,
...mailConfig
});
logger.debug(`...email ${mailConfigIndex + 1}/${mailConfigs.length} with subject "${mailConfig.subject}" was sent successfully.`);
return response;
}
catch (error) {
logger.error(`Failed to send email ${mailConfigIndex + 1}/${mailConfigs.length} with subject "${mailConfig.subject}". Error: ${error.message}`);
return {
response: error.response,
rejected: error.rejected
};
}
});
return Promise.all(promises).then(responses => {
responses.forEach((_, responseIndex) => logger.debug(`...email ${responseIndex + 1}/${mailConfigs.length} for subject "${mailConfigs[responseIndex].subject}" was sent successfully`));
return responses;
});
return Promise.all(promises);
}

@@ -153,0 +170,0 @@ async function sendMailWithNodemailer(mailDestination, mailConfigs, mailClientOptions) {

{
"name": "@sap-cloud-sdk/mail-client",
"version": "3.22.3-20241114014128.0",
"version": "3.22.3-20241114134823.0",
"description": "SAP Cloud SDK for JavaScript e-mail client",

@@ -37,8 +37,7 @@ "homepage": "https://sap.github.io/cloud-sdk/docs/js/overview",

"check:dependencies": "depcheck .",
"check:public-api": "ts-node ../../scripts/check-public-api-cli.ts",
"readme": "ts-node ../../scripts/replace-common-readme.ts"
},
"dependencies": {
"@sap-cloud-sdk/connectivity": "^3.22.3-20241114014128.0",
"@sap-cloud-sdk/util": "^3.22.3-20241114014128.0",
"@sap-cloud-sdk/connectivity": "^3.22.3-20241114134823.0",
"@sap-cloud-sdk/util": "^3.22.3-20241114134823.0",
"nodemailer": "6.9.16",

@@ -45,0 +44,0 @@ "socks": "2.8.3"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc