1.1.0 • Published 1 month ago

@fabbijsc/medusa-plugin-aws-ses v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

AWS SES (Fabbi JSC)

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

npm i @fabbijsc/medusa-plugin-aws-ses

2. Set the following environment variables in .env:

AWS_ACCESS_KEY=
AWS_SECRET_KEY=
AWS_REGION=
SES_SENDER=

3. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
  // ...
  {
    resolve: `@fabbijsc/medusa-plugin-aws-ses`,
      options: {
          aws_credential: {
              access_key: process.env.AWS_ACCESS_KEY,
              secret_key: process.env.AWS_SECRET_KEY,
              region: process.env.AWS_REGION,
              sender: process.env.SES_SENDER,
          },
      }
  },
]

Use the Plugin

import { TransactionBaseService } from '@medusajs/medusa';
import { ISesOption, SesService } from '@fabbijsc/medusa-plugin-aws-ses/dist';
import { EMailType } from '@enums/Mail.enum';

type ConstructorParams = {
  sesService: SesService;
};

interface IOption extends ISesOption {
  type: EMailType;
}

class MailService extends TransactionBaseService {
  sesService: SesService;

  constructor(private readonly container: ConstructorParams) {
  super(container);
  this.sesService = container.sesService;
}

async send(option: IOption): Promise<void> {
  await this.sesService.send(option, false);
}
}

export default MailService;
1.1.0

1 month ago

1.0.9

1 month ago

1.0.8

1 month ago

1.0.6

1 month ago

1.0.5

1 month ago

1.0.4

1 month ago

1.0.3

1 month ago

1.0.1

1 month ago

1.0.0

1 month ago