Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
strapi-provider-email-gmail-2lo
Advanced tools
Gmail provider with 2-legged OAuth and a service account for the Strapi framework
This package is an email provider for the headless CMS Strapi.
You can use this provider to send mail programmatically with strapi-plugin-email
.
This provider enables you to send email with the Gmail API using a 2-legged OAuth configuration, when using G Workspace.
Supported versions:
Not having Google Workspace (previously G suite) will not work with this provider.
# using yarn
yarn add strapi-provider-email-gmail-2lo
# using npm
npm install strapi-provider-email-gmail-2lo --save
config/plugins
Variable | Type | Description | Required | Default |
---|---|---|---|---|
provider | string | The name of the provider you use | yes | |
providerOptions | object | Provider options | yes | |
providerOptions.username | string | An existing email address within your domain/project | yes | |
providerOptions.clientId | number | Service account API Client id | yes | |
providerOptions.privateKey | string | Service account private key | yes | |
settings | object | Settings | no | {} |
settings.defaultFrom | string | Default sender mail address, exist in domain | no | undefined |
settings.defaultReplyTo | string | array | Default address or addresses the receiver is asked to reply to | no | undefined |
The following steps will authorize the right scope, to allow sending email with G Workspace:
client_id
Path - config/plugins.js
module.exports = ({ env }) => ({
// ...
email: {
provider: 'gmail-2lo',
providerOptions: {
username: 'myemail@example.com',
clientId: env('EMAIL_CLIENT_ID'),
privateKey: env('EMAIL_PRIVATE_KEY').replace(/\\n/g, '\n'),
},
settings: {
defaultFrom: 'myemail@example.com',
defaultReplyTo: 'myemail@example.com',
},
},
// ...
});
TIP: When using environment variables for your privateKey, as in the example above, include all the \n
in you .env file, like so:
EMAIL_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nAbC...xYz\n-----END PRIVATE KEY-----\n"
FAQs
Gmail provider with 2-legged OAuth and a service account for the Strapi framework
The npm package strapi-provider-email-gmail-2lo receives a total of 28 weekly downloads. As such, strapi-provider-email-gmail-2lo popularity was classified as not popular.
We found that strapi-provider-email-gmail-2lo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.