Skip to main content

Built and signed on GitHub Actions

A collection of useful utilities for Byteminds PH

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.1.4)
function composeMessage
composeMessage(
from: string,
to: string,
subject: string,
body: string,
): ComposeMessage

Composes an email message object with the specified sender, recipient, subject, and body content.

Examples

const from = 'sender@example.com'; const to = 'recipient@example.com'; const subject = 'Hello!'; const body = '

This is a test email.

';

const message = mod.composeMessage(from, to, subject, body);

console.log(message); // Output: // { // from: 'sender@example.com', // to: 'recipient@example.com', // subject: 'Hello!', // html: '

This is a test email.

', // }

Parameters

from: string
  • The email address of the sender.
  • The email address of the recipient.
subject: string
  • The subject line of the email.
body: string
  • The HTML content of the email body.

Return Type

ComposeMessage
  • An object representing the composed email message. This object includes:
  • from: The sender's email address.
  • to: The recipient's email address.
  • subject: The subject line of the email.
  • html: The HTML content of the email body.

Add Package

deno add jsr:@jhenbert/byteminds-util

Import symbol

import { composeMessage } from "@jhenbert/byteminds-util";

---- OR ----

Import directly with a jsr specifier

import { composeMessage } from "jsr:@jhenbert/byteminds-util";

Add Package

npx jsr add @jhenbert/byteminds-util

Import symbol

import { composeMessage } from "@jhenbert/byteminds-util";

Add Package

yarn dlx jsr add @jhenbert/byteminds-util

Import symbol

import { composeMessage } from "@jhenbert/byteminds-util";

Add Package

pnpm dlx jsr add @jhenbert/byteminds-util

Import symbol

import { composeMessage } from "@jhenbert/byteminds-util";

Add Package

bunx jsr add @jhenbert/byteminds-util

Import symbol

import { composeMessage } from "@jhenbert/byteminds-util";