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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cross-solution/strapi-plugin-async-mail

v0.0.16

Published

This is the description of the plugin.

Downloads

3

Readme

Strapi plugin async-mail

Status: Work in Progress

The async-mail plugin makes it possible to send form data from anonymous users to a defined email address. Form data is stored in a collection and sent asyncronously by a cronjob. A typical use case is a contact form that is supposed to send entered data to a defined email address.

🖐 Requirements

  • strapi 4
  • nodes 18|20

⏳ Install

The async-mail is based on the Strapi Email Service. To send emails you need an email plugin. If you just want to send mails via SMTP, we recommend @strapi/provider-email-nodemailer. However, you can use any other Email Provider Plugin. The configuration of the email plugin provider used can be found in the corresponding documentation. E.g. Nodemailer configuration is located in the Readme

yarn add @strapi/provider-email-nodemailer
yarn add @cross-solution/strapi-plugin-async-mail

Configuration:

The default configuration is as follows (you must add it to ./config/plugin.js):

module.exports = {
  // ...
  "async-mail": {
    enabled: true,
    config: {
      scanLimit: env.int("SCAN_LIMIT", 10),
      recipient: env("ASYNC_MAIL_RECIPIENT"),
    },
  },
  // ...
}

🔌 Usage

The plugin expects the environment variables ASYNC_MAIL_RECIPIENT and EMAIL_SETTINGS_FROM. Both variables must be defined in the .env

Simple mail

A simple mail sets the subject and the text of the mail according to the parameters subject and message.

curl -s -d "subject=Mail+Subject&message=Mail+Body+Text" "http://127.0.0.1:1337/async-mail" | jq "."
{
  "id": 60,
  "subject": "Mail Subject",
  "message": "Mail Body Text",
  "status": "new",
  "from": "[email protected]",
  "recipient": "[email protected]",
  "sentAt": null,
  "replyTo": "[email protected]",
  "priority": null,
  "meta": {},
  "createdAt": "2024-07-10T08:36:10.099Z",
  "updatedAt": "2024-07-10T08:36:10.099Z",
  "isTemplated": false,
  "uid": ""
}

Templated Mail

Mail templates with placeholders can be defined. Async Mail comes with a DEFAULT template, which recognizes the valid placeholders. The values of the placeholders can be passed as POST parameters.

Example

curl -s -d "subject=subject&text=text&contact=123&message=123&company=1235&phone=123&[email protected]&name=test&uid=DEFAULT" http://localhost:1337/async-mail | jq "."
{
  "id": 61,
  "subject": "subject",
  "message": "123",
  "status": "new",
  "from": "[email protected]",
  "recipient": "[email protected]",
  "sentAt": null,
  "replyTo": "[email protected]",
  "priority": null,
  "meta": {
    "text": "text",
    "contact": "123",
    "company": "1235",
    "phone": "123",
    "email": "[email protected]",
    "name": "test"
  },
  "createdAt": "2024-07-10T08:38:23.415Z",
  "updatedAt": "2024-07-10T08:38:23.415Z",
  "isTemplated": true,
  "uid": "DEFAULT"
}

Collections

The plug creates the collections

  • async-mail-outbox
  • async-mail-templates

License

This plugin is licensed under the MIT License. See the LICENSE file for more information.