UNPKG

free-mail-sender

Version:

This Strapi plugin is designed to streamline the process of sending emails through the REST API. It enables you to send emails using different providers and customize the email content to suit your specific needs.

62 lines (56 loc) 1.56 kB
import { prefixPluginTranslations } from "@strapi/helper-plugin"; import pluginPkg from "../../package.json"; import pluginId from "./pluginId"; import Initializer from "./components/Initializer"; import PluginIcon from "./components/PluginIcon"; const name = pluginPkg.strapi.name; export default { register(app) { app.addMenuLink({ to: `/plugins/${pluginId}`, icon: PluginIcon, intlLabel: { id: `${pluginId}.plugin.name`, defaultMessage: "Contact Email: Token Gen", }, Component: async () => { const component = await import("./pages/App"); return component; }, permissions: [ // Uncomment to set the permissions of the plugin here // { // action: '', // the action name should be plugin::plugin-name.actionType // subject: null, // }, ], }); app.registerPlugin({ id: pluginId, initializer: Initializer, isReady: false, name, }); }, bootstrap(app) {}, async registerTrads({ locales }) { const importedTrads = await Promise.all( locales.map((locale) => { return import(`./translations/${locale}.json`) .then(({ default: data }) => { return { data: prefixPluginTranslations(data, pluginId), locale, }; }) .catch(() => { return { data: {}, locale, }; }); }), ); return Promise.resolve(importedTrads); }, };