Code Monkey home page Code Monkey logo

strapi-plugin-email-designer's Introduction

Strapi email designer plugin ๐Ÿ’…

NPM Version Monthly download on NPM code style: prettier PRs welcome! License Follow Alex Zaganelli Repo stars

Design your own email templates directly from the Strapi CMS admin panel and use the magic to send programmatically email from your controllers / services.

Designer screenshot

Visual composer provided by Unlayer

ย 

โณ Installation

Install Strapi with this Quickstart command to create a Strapi project instantly:

# with yarn
yarn create strapi-app my-project --quickstart

# with npm/npx
npx create-strapi-app my-project --quickstart

This command generates a brand new project with the default features (authentication, permissions, content management, content type builder & file upload). The Quickstart command installs Strapi using a SQLite database which is used for prototyping in development.

  • Add the strapi-designer plugin
yarn add strapi-plugin-email-designer@latest

# or

npm i -S strapi-plugin-email-designer@latest
  • After successful installation you've to build a fresh package that includes plugin UI. To archive that simply use:
yarn build && yarn develop

# or

npm run build && npm run develop
  • or just run Strapi in the development mode with --watch-admin option:
yarn develop --watch-admin

#or

npm run develop --watch-admin

The Email Designer plugin should appear in the Plugins section of Strapi sidebar after you run app again.

๐Ÿ’„ Usage

  1. Design your template with easy on the visual composer

  2. Send email programmatically:

{
  // ...

  const templateId = "[GET_THE_TEMPLATE_ID]",
    to: "[email protected]",
    from: "[email protected]",
    replyTo: "[email protected]",
    subject: "[TEST] This is a test using strapi-email-designer",
    userData: {
      firstname: "Alex",
      lastname: "Zaganelli",
      email: "[email protected]",
    };

  try {
    await strapi.plugins["email-designer"].services.email.send({
      templateId,
      to,
      from,
      replyTo,
      subject,
      data: userData,
    });
  } catch (err) {
    strapi.log.debug("๐Ÿ“บ: ", err);
    return ctx.badRequest(null, err);
  }

  // ...
}
  1. or simply get the composed body mail
{
  // ...

  const templateId = "[GET_THE_TEMPLATE_ID]",
    userData: {
      firstname: "Alex",
      lastname: "Zaganelli",
      email: "[email protected]",
    };

  const { composedHtml, composedText } = await strapi.plugins["email-designer"].services.email.compose({
    templateId,
    data: userData,
  });

  // ...
}

Enjoy ๐ŸŽ‰

๐Ÿ– Requirements

Complete installation requirements are exact same as for Strapi itself and can be found in the documentation under Installation Requirements.

Supported Strapi versions:

  • Strapi v3.4.x

(This plugin may work with the older Strapi versions, but these are not tested nor officially supported at this time.)

Node / NPM versions:

  • NodeJS >= 12.10 <= 14
  • NPM >= 6.x

We recommend always using the latest version of Strapi to start your new projects.

๐Ÿšง Roadmap

  • Template composer helper
  • Import design functionality
  • Preview email with real data
  • Override Strapi's core email system
  • Tags functionality
  • Custom components extension
  • Complete UI tests
  • i18n translations

๐Ÿค Contributing

Feel free to fork and make a Pull Request to this plugin project. All the input is warmly welcome!

โญ๏ธ Show your support

Give a star if this project helped you. You can also offer me a beer ๐Ÿป.

๐Ÿ”— Links

๐ŸŒŽ Community support

๐Ÿ“ License

MIT License Copyright (c) 2020 Alex Zaganelli & Strapi Solutions.

strapi-plugin-email-designer's People

Contributors

alexzaganelli avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.