Strapi plugin logo for Mailpit

Mailpit

Mailpit SMTP testing tool provider

@piksail/strapi-provider-email-mailpit

Strapi email provider for Mailpit

Installation

# using yarn
yarn add @piksail/strapi-provider-email-mailpit

# using npm
npm install @piksail/strapi-provider-email-mailpit --save

Configuration

VariableTypeDescriptionRequiredDefault
providerstringThe name of the provider you useyes
providerOptionsobjectProvider optionsyes
providerOptions.baseUrlobjectMailpit urlnohttp://localhost:8025
settingsobjectSettings (See Mailpit API Doc)no{}
settings.defaultFromstringDefault sender mail addressnoundefined
settings.defaultReplyTostringDefault replyTo mail addressnoundefined
settings.verbosestringPrint detailled logs. Does not print Authorization header. Use with caution, might leak sensitive data in logsnofalse

:warning: The Shipper Email (or defaultfrom) may also need to be changed in the Email Templates tab on the admin panel for emails to send properly

Example

Path - config/plugins.js

1module.exports = ({ env }) => ({
2  // ...
3  email: {
4    config: {
5      provider: "@piksail/strapi-provider-email-mailpit",
6      providerOptions: {
7        baseUrl: env("MAILPIT_BASE_URL"), // default to http://localhost:8025. Must not contain any path, ex: https://mailpit.example.com
8      },
9      settings: {
10        verbose: false, // Use with caution, might leak sensitive data in logs
11        defaultFrom: { email: "john@example.com", name: "John" },
12        defaultReplyTo: [{ email: "noreply@example.com", name: "NoReply" }], // Some options require an array containing objects with email and name. Refer to https://mailpit.axllent.org/docs/api-v1/view.html#post-/api/v1/send
13        headers: {
14          Authorization:
15            "Basic " +
16            Buffer.from(
17              `${env("MAILPIT_USERNAME")}:${env("MAILPIT_PASSWORD")}`
18            ).toString("base64"),
19        },
20      },
21    },
22  },
23  // ...
24});

Troubleshoot

Turn on verbose for easier debugging.

Couldn't send test email: Unknown route. Check your baseUrl setting, it should look like this: https://mailpit.example.com.

Install now

npm install @piksail/strapi-provider-email-mailpit

STATS

No GitHub star yet3 weekly downloads

Last updated

168 days ago

Strapi Version

Unavailable

Author

github profile image for Piksail
Piksail

Related plugin

Email

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.