npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sharpapi/sharpapi-node-thank-you-email

v1.0.1

Published

SharpAPI.com Node.js SDK for generating thank you emails

Downloads

14

Readme

SharpAPI GitHub cover

Thank You Email Generator API for Node.js

💌 Generate personalized thank you emails — powered by SharpAPI AI.

npm version License

SharpAPI Thank You Email Generator creates personalized, professional thank you emails for e-commerce transactions. Perfect for order confirmations, customer appreciation, and post-purchase communication.


📋 Table of Contents

  1. Requirements
  2. Installation
  3. Usage
  4. API Documentation
  5. Examples
  6. License

Requirements

  • Node.js >= 16.x
  • npm or yarn

Installation

Step 1. Install the package via npm:

npm install @sharpapi/sharpapi-node-thank-you-email

Step 2. Get your API key

Visit SharpAPI.com to get your API key.


Usage

const { SharpApiThankYouEmailService } = require('@sharpapi/sharpapi-node-thank-you-email');

const apiKey = process.env.SHARP_API_KEY; // Store your API key in environment variables
const service = new SharpApiThankYouEmailService(apiKey);

const orderData = {
  customerName: 'John Doe',
  productName: 'Wireless Headphones',
  orderNumber: 'ORD-12345'
};

async function generateThankYou() {
  try {
    // Submit email generation job
    const statusUrl = await service.generateThankYouEmail(
      orderData.customerName,
      orderData.productName,
      orderData.orderNumber
    );
    console.log('Job submitted. Status URL:', statusUrl);

    // Fetch results (polls automatically until complete)
    const result = await service.fetchResults(statusUrl);
    console.log('Generated email:', result.getResultJson());
  } catch (error) {
    console.error('Error:', error.message);
  }
}

generateThankYou();

API Documentation

Methods

generateThankYouEmail(customerName: string, productName: string, orderNumber?: string, voiceTone?: string): Promise<string>

Generates a personalized thank you email.

Parameters:

  • customerName (string, required): Customer's name
  • productName (string, required): Product or service purchased
  • orderNumber (string, optional): Order reference number
  • voiceTone (string, optional): Tone of the email ('Professional', 'Friendly', 'Enthusiastic')

Returns:

  • Promise: Status URL for polling the job result

Example:

const statusUrl = await service.generateThankYouEmail(
  'Sarah Johnson',
  'Premium Yoga Mat',
  'ORD-67890',
  'Friendly'
);
const result = await service.fetchResults(statusUrl);

Response Format

The API returns a professionally crafted thank you email:

{
  "email": "Thank you, John! We hope you enjoy your new Wireless Headphones. They're designed to deliver exceptional sound quality and comfort for all-day listening. If you have any questions or need support, we're here to help. Thanks for choosing us!",
  "subject": "Thank You for Your Order #ORD-12345",
  "tone": "Friendly"
}

Examples

Basic Thank You Email

const { SharpApiThankYouEmailService } = require('@sharpapi/sharpapi-node-thank-you-email');

const service = new SharpApiThankYouEmailService(process.env.SHARP_API_KEY);

service.generateThankYouEmail(
  'Emma Wilson',
  'Organic Coffee Beans',
  'ORD-11223'
)
  .then(statusUrl => service.fetchResults(statusUrl))
  .then(result => {
    const email = result.getResultJson();
    console.log('📧 Subject:', email.subject);
    console.log('📝 Body:', email.email);
  })
  .catch(error => console.error('Generation failed:', error));

Tone-Specific Email

const service = new SharpApiThankYouEmailService(process.env.SHARP_API_KEY);

const statusUrl = await service.generateThankYouEmail(
  'Michael Chen',
  'Professional Camera Lens',
  'ORD-55789',
  'Professional'
);

const result = await service.fetchResults(statusUrl);
const email = result.getResultJson();

console.log('Professional thank you email:');
console.log(email.email);

Automated Post-Purchase Workflow

const service = new SharpApiThankYouEmailService(process.env.SHARP_API_KEY);

async function sendThankYouEmail(order) {
  // Generate personalized email
  const statusUrl = await service.generateThankYouEmail(
    order.customerName,
    order.productName,
    order.orderNumber,
    'Enthusiastic'
  );

  const result = await service.fetchResults(statusUrl);
  const emailContent = result.getResultJson();

  // In real implementation, integrate with email service
  return {
    to: order.customerEmail,
    subject: emailContent.subject,
    body: emailContent.email,
    orderRef: order.orderNumber
  };
}

const completedOrder = {
  orderNumber: 'ORD-99888',
  customerName: 'Lisa Brown',
  customerEmail: '[email protected]',
  productName: 'Smart Fitness Watch'
};

const emailToSend = await sendThankYouEmail(completedOrder);
console.log('Email ready to send:', emailToSend);

Batch Email Generation

const service = new SharpApiThankYouEmailService(process.env.SHARP_API_KEY);

const orders = [
  { customerName: 'Alice Green', product: 'Yoga Mat', orderId: 'ORD-001' },
  { customerName: 'Bob Smith', product: 'Water Bottle', orderId: 'ORD-002' },
  { customerName: 'Carol White', product: 'Running Shoes', orderId: 'ORD-003' }
];

const thankYouEmails = await Promise.all(
  orders.map(async (order) => {
    const statusUrl = await service.generateThankYouEmail(
      order.customerName,
      order.product,
      order.orderId,
      'Friendly'
    );
    const result = await service.fetchResults(statusUrl);
    return {
      orderId: order.orderId,
      email: result.getResultJson()
    };
  })
);

console.log(`Generated ${thankYouEmails.length} thank you emails`);

Use Cases

  • Order Confirmations: Send personalized thank you after purchase
  • Service Subscriptions: Thank customers for signing up
  • Event Registrations: Acknowledge event sign-ups
  • Donation Receipts: Thank donors for contributions
  • Trial Sign-ups: Welcome new trial users
  • Membership Renewals: Thank customers for renewing
  • Customer Appreciation: Build relationships with personalized messages

Voice Tones

Choose the appropriate tone for your brand:

  • Professional: Formal, business-appropriate language
  • Friendly: Warm, casual, conversational
  • Enthusiastic: Energetic, exciting, motivational
  • Grateful: Emphasizes appreciation and gratitude
  • Luxury: Sophisticated, premium, exclusive

Personalization Features

Each email includes:

  • Customer's name: Personal address
  • Product reference: Specific item purchased
  • Order number: Transaction reference
  • Brand voice: Consistent with your tone choice
  • Call-to-action: Subtle engagement prompt
  • Support offer: Invitation to reach out

API Endpoint

POST /ecommerce/thank_you_email

For detailed API specifications, refer to:


Related Packages


License

This project is licensed under the MIT License. See the LICENSE.md file for details.


Support


Powered by SharpAPI - AI-Powered API Workflow Automation