From a7139ddf3d7a0f02e5f59d17b9706f9db3af97e7 Mon Sep 17 00:00:00 2001 From: Mattias van den Belt Date: Thu, 10 Sep 2020 12:25:56 +0200 Subject: [PATCH] Update README.md for using .env --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f12bc68..b247523 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ module.exports = ({ env }) => ({ providerOptions: { username: 'myemail@example.com', clientId: env('EMAIL_CLIENT_ID'), - privateKey: env('EMAIL_PRIVATE_KEY'), + privateKey: env('EMAIL_PRIVATE_KEY').replace(/\\n/g, '\n'), }, settings: { defaultFrom: 'myemail@example.com', @@ -56,6 +56,12 @@ module.exports = ({ env }) => ({ }); ``` +**TIP:** When using environment variables for your privateKey, as in the example above, include all the `\n` in you .env file, like so: +```..env +EMAIL_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nAbC...xYz\n-----END PRIVATE KEY-----\n" +``` + + ### G Suite When using G Suite follow these steps authorize the right scopes: 1) Go to G Suite admin dashboard > Security > Advanced settings > [Manage domain-wide delegation](https://admin.google.com/ac/owl/domainwidedelegation)