@netlify/plugin-emails
Advanced tools
Comparing version 0.4.3-preview to 0.4.4-preview
@@ -254,2 +254,3 @@ "use strict"; | ||
provider = ${JSON.stringify(providerName)} | ||
emailDirectory = ${JSON.stringify(emailTemplatesDirectory)} | ||
secret = ${JSON.stringify(process.env.NETLIFY_EMAILS_SECRET)} | ||
@@ -256,0 +257,0 @@ url = ${JSON.stringify(process.env.URL)} |
{ | ||
"name": "@netlify/plugin-emails", | ||
"version": "0.4.3-preview", | ||
"version": "0.4.4-preview", | ||
"description": "A build plugin that creates an email handler and processes requests to send emails", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -357,2 +357,3 @@ import { Handler } from "@netlify/functions"; | ||
provider = ${JSON.stringify(providerName)} | ||
emailDirectory = ${JSON.stringify(emailTemplatesDirectory)} | ||
secret = ${JSON.stringify(process.env.NETLIFY_EMAILS_SECRET)} | ||
@@ -359,0 +360,0 @@ url = ${JSON.stringify(process.env.URL)} |
@@ -16,2 +16,3 @@ import { describe, beforeEach, vi, it, expect, afterEach } from "vitest"; | ||
SITE_ID: "testSiteId", | ||
SITE_NAME: "testSiteName", | ||
CONTEXT: "dev", | ||
@@ -82,26 +83,12 @@ URL: "http://localhost:8888", | ||
// Get siteId variable from html string | ||
// E.g. siteId = "testSiteId" | ||
const siteId = response.body?.match(/siteId = "(.*)"/)?.[1]; | ||
// Get templateName variable from html string | ||
// E.g. templateName = "booking-confirmed" | ||
const siteName = response.body?.match(/siteName = "(.*)"/)?.[1]; | ||
const templateName = response.body?.match(/templateName = "(.*)"/)?.[1]; | ||
// Get template variable from html string | ||
// E.g. template = "<html><body><h1>Booking confirmed</h1></body></html>" | ||
const template = response.body?.match(/template = "(.*)"/)?.[1]; | ||
// Get templateType variable from html string | ||
// E.g. templateType = "html" | ||
const templateType = response.body?.match(/templateType = "(.*)"/)?.[1]; | ||
// Get url variable from html string | ||
// E.g. url = "http://localhost:8888" | ||
const url = response.body?.match(/url = "(.*)"/)?.[1]; | ||
// Get secret variable from html string | ||
// E.g secret = "test" | ||
const secret = response.body?.match(/secret = "(.*)"/)?.[1]; | ||
const emailDirectory = response.body?.match(/emailDirectory = "(.*)"/)?.[1]; | ||
expect(response.body).toContain( | ||
@@ -119,3 +106,5 @@ "<script defer src='https://netlify-integration-emails.netlify.app/index.js'>" | ||
expect(secret).toEqual("test-secret"); | ||
expect(emailDirectory).toEqual("./fixtures/emails"); | ||
expect(siteName).toEqual("testSiteName"); | ||
}); | ||
}); |
67342
1723