npm package: @me_tech/invitation-email-admin-user
Description: Invitation Email Admin User
Author: Mendrika
Latest version: 0.0.2

<div align="center">

# Invitation Email Admin User Plugin

Automates Strapi admin invitations by seeding a customizable email template and sending registration links whenever a new admin user is created.

</div>

## Features

1. **Email template bootstrap** – On startup the plugin ensures a `send_magic_link_invite` template exists inside the `users-permissions` plugin store, pre-populating sender, subject, and HTML body fields.@server/src/bootstrap.js#3-33
2. **Admin user lifecycle hook** – Subscribes to `admin::user` creation events, renders the template with the admin invite link, and dispatches it through Strapi’s email provider.@server/src/bootstrap.js#34-70
3. **Lightweight admin entrypoint** – Registers the plugin inside the Strapi admin app, exposing an initializer component and translation loader scaffold for future UI extensions.@admin/src/index.js#1-31
4. **Sample controller & service** – Demonstrates how to expose backend endpoints through the plugin’s controller/service pattern.@server/src/controllers/controller.js#1-11 @server/src/services/service.js#1-7

## Project layout

```
invitation-email-admin-user/
├─ admin/              # Strapi admin bundle (React)
│   ├─ src/index.js    # Plugin registration & translation loading
│   ├─ src/components/Initializer.jsx
│   └─ src/utils/getTranslation.js
└─ server/             # Strapi server bundle (Node.js)
    ├─ src/bootstrap.js
    ├─ src/controllers/
    ├─ src/services/
    └─ src/routes/
```

## Requirements

- Node.js 20+
- Yarn Classic (1.x)
- Strapi `^5.31.2`
- A configured Strapi email provider (used to deliver admin invitations)

All runtime, dev, and peer dependencies live in `package.json` for quick reference.@package.json#1-63

## Installation

1. Copy or symlink this repository into your Strapi project under `./src/plugins/invitation-email-admin-user`.
2. Install dependencies and build the plugin once:
   ```bash
   yarn install
   yarn build
   ```
3. From your Strapi application, run `yarn develop --watch-admin` (or `yarn develop`) so the new plugin is compiled into the admin panel.

> **Tip:** During local development, run `yarn watch` or `yarn watch:link` inside the plugin to rebuild assets automatically.@package.json#23-28

## Configuration

### Email provider & admin URL

- Configure an email provider through Strapi’s official email plugin; the invitation workflow reads `defaultFrom` and `defaultReplyTo` from the provider settings before sending messages.@server/src/bootstrap.js#40-66
- Ensure `admin.url` is set in your Strapi configuration because invite links use `${strapi.config.get('admin.url')}/auth/register?...`.@server/src/bootstrap.js#46-53

### Customizing the template

- The seeded template is stored under the `users-permissions` plugin store key `email.send_magic_link_invite` and can be edited either by modifying `server/src/bootstrap.js` or updating the stored JSON directly.@server/src/bootstrap.js#6-52
- Template variables available to the renderer:
  - `URL` – The generated registration link.
  - `USER` – The admin user entity just created.

## Usage

1. Create an admin user from the Strapi dashboard or through the Admin Users API.
2. The lifecycle hook renders the template and sends the invitation to the user’s email automatically.
3. Optionally, hit the sample controller (`GET /invitation-email-admin-user`) to confirm the plugin is registered; it returns the welcome message defined in the service layer.@server/src/controllers/controller.js#1-11 @server/src/services/service.js#1-7

## Development workflow

| Script | Description |
| ------ | ----------- |
| `yarn build` | Runs `strapi-plugin build` to emit production assets into `dist/`.@package.json#23-28 |
| `yarn watch` | Watches admin + server sources for changes and rebuilds automatically.@package.json#23-28 |
| `yarn watch:link` | Builds and outputs artifacts suitable for linking into another Strapi app during development.@package.json#23-28 |

When iterating on the admin UI, keep `yarn watch` running here and `yarn develop --watch-admin` in your host Strapi project for hot reloads.

## License

MIT © Mendrika Ralison@package.json#58-61