New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gmail-node-mailer

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gmail-node-mailer - npm Package Compare versions

Comparing version 1.8.8 to 1.8.9

2

dist/index.js
"use strict";
// src/index.ts
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

@@ -19,4 +18,5 @@ if (k2 === undefined) k2 = k;

exports.GmailMailer = void 0;
// ./src/index.ts
__exportStar(require("./types/types"), exports);
var GmailMailer_1 = require("./GmailMailer");
Object.defineProperty(exports, "GmailMailer", { enumerable: true, get: function () { return GmailMailer_1.GmailMailer; } });
{
"name": "gmail-node-mailer",
"version": "1.8.8",
"version": "1.8.9",
"description": "gmail-node-mailer is a Node.js library for easy email sending via the Gmail API, featuring quick setup, HTML/plain text support, dynamic configuration for streamlined email integration, and now with support for attachments.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -35,3 +35,9 @@ /**

import { gmailServiceAccountConfig } from './config/gmailServiceAccountConfig';
import { ISendEmailParams, ISendEmailResponse, ISendEmailFunctionResponse, IInitializeClientParams, IInitializeClientResult } from './types/types';
import {
ISendEmailParams,
ISendEmailResponse,
IInitializeClientParams,
IInitializeClientResult,
ISendEmailFunctionResponse,
} from './types/types';

@@ -161,3 +167,3 @@ export class GmailMailer {

if (!senderEmail) {
console.error('Sender email not configured. Please provide a sender email.');
console.error('Sender email not configured. Please provide a sender email.')
return generateErrorResponse({ message: 'Sender email not configured. Please provide a sender email.' });

@@ -167,3 +173,3 @@ }

if (!params.message) {
console.error('At least one of textMessage or htmlMessage must be provided.');
console.error('At least one of textMessage or htmlMessage must be provided.')
return generateErrorResponse({ message: 'At least one of textMessage or htmlMessage must be provided.' });

@@ -174,3 +180,3 @@ }

console.error(`No subject provided for the email to ${params.recipientEmail}.`);
params.subject = 'No Subject'; // Default subject if none provided
params.subject = 'No Subject';
}

@@ -181,13 +187,10 @@

const domainPart = senderEmail.substring(senderEmail.lastIndexOf("@") + 1);
const rawSenderName = domainPart.substring(0, domainPart.indexOf('.')); // Fixes to use indexOf
params.senderName = rawSenderName.charAt(0).toUpperCase() + rawSenderName.slice(1); // Properly concatenates the rest of the name
const rawSenderName = domainPart.substring(0, domainPart.indexOf('.'));
params.senderName = rawSenderName.charAt(0).toUpperCase() + rawSenderName.slice(1)
}
// Adjust parameters including senderEmail and possibly modified params such as senderName
const adjustedParams = { ...params, senderEmail };
// Call the lower-level sendEmailFunction to actually send the email
const sendResult: ISendEmailFunctionResponse = await sendEmailFunction(this.gmailClient, adjustedParams);
// Handle the response based on the sending result
if (!sendResult.sent) {

@@ -206,2 +209,3 @@ return generateErrorResponse({ message: sendResult.message });

}
}

@@ -1,4 +0,4 @@

// src/index.ts
// ./src/index.ts
export * from './types/types';
export * from './types/types';
export { GmailMailer } from './GmailMailer';
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