evtuhovdo
evtuhovdo

Reputation: 334

Strapi 4.1.5 email plugin configuration

Unable to change email configuration. I specify the settings according to the instructions.

In any case, the default plugin configuration is used.

node v14.18.2 strapi 4.1.5

{
  "name": "strapi-test",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "devDependencies": {},
  "dependencies": {
    "@strapi/plugin-i18n": "4.1.5",
    "@strapi/plugin-users-permissions": "4.1.5",
    "@strapi/provider-email-nodemailer": "^4.1.5",
    "@strapi/strapi": "4.1.5",
    "sqlite3": "5.0.2"
  },
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "87e9d8e3-8c82-4c8e-8de4-990c2b729be4"
  },
  "engines": {
    "node": ">=12.x.x <=16.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}

enter image description here

enter image description here

enter image description here


SOLUTION https://github.com/strapi/strapi/issues/12919#issuecomment-1075954840

Upvotes: 1

Views: 1983

Answers (1)

Rizki Aprita
Rizki Aprita

Reputation: 103

in case anyone looking for the answer for this. derrick m, discord

like derick says, in strapi v4 the provider and providerOptions need to be wrapped inside config. like this

module.exports = ({ env }) => ({
    // ...
    email: {
      config: {
        provider: 'nodemailer',
        providerOptions: {
          host: env('SMTP_HOST', 'smtp.gmail.com'),
          port: env('SMTP_PORT', 465),
          auth: {
            user: env('SMTP_USERNAME', '[email protected]'),
            pass: env('SMTP_PASSWORD', 'password'),
          },
        },
        settings: {
          defaultFrom: '[email protected]',
          defaultReplyTo: '[email protected]',
        },
      },
    },
    // ...
  });

Upvotes: 2

Related Questions