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

@techie04/xpresser-mailer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@techie04/xpresser-mailer - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

5

index.d.ts
/// <reference types="node" />
import { Address, AttachmentLike } from "nodemailer/lib/mailer";
import { Address, AttachmentLike, Attachment } from "nodemailer/lib/mailer";
import { Readable } from "stream";
export declare const sendMail: ($to: string | Address | Array<string | Address>, $subject: string, $message: string | Buffer | Readable | AttachmentLike, $messageType?: string) => Promise<void>;
export declare const sendMail: ($to: string | Address | Array<string | Address>, $subject: string, $message: string | Buffer | Readable | AttachmentLike, $messageType?: string, $attachments?: Attachment[] | undefined) => Promise<void>;
export declare type AttachmentType = Attachment;

@@ -59,3 +59,3 @@ "use strict";

}
const sendMail = async ($to, $subject, $message, $messageType = "html") => {
const sendMail = async ($to, $subject, $message, $messageType = "html", $attachments) => {
const from = config.get("from") || $.config.get("name");

@@ -66,3 +66,4 @@ const mail = {

subject: $subject,
...($messageType === "html" ? { html: $message } : { text: $message })
...($messageType === "html" ? { html: $message } : { text: $message }),
...($attachments && { attachments: $attachments })
};

@@ -69,0 +70,0 @@ await transporter.sendMail(mail);

2

package.json
{
"name": "@techie04/xpresser-mailer",
"version": "0.0.3",
"version": "0.1.0",
"description": "mailer helper for xpresser",

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

@@ -68,2 +68,13 @@ # XpresserJs Mailer Plugin

(async () => {
// array of attachments
const attachments = [
{
// filename (optional)
filename: "techieoriname.png",
// file path or url
path: path.join(__dirname, "..", "TechieOriname.png")
}
]
await sendMail(

@@ -73,3 +84,4 @@ "example@example.com", // to email

"my message here", // message body
"text" // message format ("html" or "text")
"text", // message format ("html" or "text")
attachments // optional field
);

@@ -82,4 +94,14 @@ });

```typescript
import { sendMail } from "@techie04/xpresser-mailer";
import { AttachmentType, sendMail } from "@techie04/xpresser-mailer";
// array of attachments
const attachments: AttachmentType[] = [
{
// filename (optional)
filename: "techieoriname.png",
// file path or url
path: path.join(__dirname, "..", "TechieOriname.png")
}
];
await sendMail(

@@ -89,4 +111,5 @@ "example@example.com",

"my message here",
"text"
"text",
attachments // optional field
);
```
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