Skip to content

Commit

Permalink
Merge pull request #19 from zalify/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
m-Ryan authored Jul 7, 2023
2 parents d2b9d60 + 50c32ec commit 3a6c06a
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 54 deletions.
14 changes: 14 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
name="description"
content="Easy email is developed based on the MJML and has very good compatibility. At the same time, it can generate code through drag-and-drop editing."
/>
<script type="text/javascript">
(function (c, l, a, r, i, t, y) {
c[a] =
c[a] ||
function () {
(c[a].q = c[a].q || []).push(arguments);
};
t = l.createElement(r);
t.async = 1;
t.src = 'https://www.clarity.ms/tag/' + i;
y = l.getElementsByTagName(r)[0];
y.parentNode.insertBefore(t, y);
})(window, document, 'clarity', 'script', '85gnvzh5py');
</script>
<%- buildTime %>
<title>easy email</title>
<!-- Google Tag Manager -->
Expand Down
77 changes: 39 additions & 38 deletions demo/src/config/getTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
import templates from '@demo/config/templates.json';

export async function getTemplate(id: string|number) {
export async function getTemplate(id: string | number) {
const item = templates.find(item => item.article_id === +id);
if (!item) return null;
let data:any = null;
let data: any = null;
switch (item.path) {

case 'Arturia - Newsletter.json':
data = (await import("@demo/templates/Arturia - Newsletter.json")).default;
case 'Arturia - Newsletter.json':
data = (await import('@demo/templates/Arturia - Newsletter.json')).default;
break;
case 'DynamicData.json':
data = (await import("@demo/templates/DynamicData.json")).default;

case 'DynamicData.json':
data = (await import('@demo/templates/DynamicData.json')).default;
break;
case 'Food.json':
data = (await import("@demo/templates/Food.json")).default;

case 'Food.json':
data = (await import('@demo/templates/Food.json')).default;
break;
case 'MJML Code - Newsletter.json':
data = (await import("@demo/templates/MJML Code - Newsletter.json")).default;

case 'MJML Code - Newsletter.json':
data = (await import('@demo/templates/MJML Code - Newsletter.json')).default;
break;
case 'Racoon - Ecommerce.json':
data = (await import("@demo/templates/Racoon - Ecommerce.json")).default;

case 'Racoon - Ecommerce.json':
data = (await import('@demo/templates/Racoon - Ecommerce.json')).default;
break;

case 'Real Estate.json':
data = (await import("@demo/templates/Real Estate.json")).default;

case 'Real Estate.json':
data = (await import('@demo/templates/Real Estate.json')).default;
break;

case 'Shop - Newsletter.json':
data = (await import('@demo/templates/Shop - Newsletter.json')).default;
break;
case 'Shop - Newsletter.json':
data = (await import("@demo/templates/Shop - Newsletter.json")).default;

case 'Sphero - Newsletter.json':
data = (await import('@demo/templates/Sphero - Newsletter.json')).default;
break;
case 'Sphero - Newsletter.json':
data = (await import("@demo/templates/Sphero - Newsletter.json")).default;

case 'Star Wars.json':
data = (await import('@demo/templates/Star Wars.json')).default;
break;
case 'Star Wars.json':
data = (await import("@demo/templates/Star Wars.json")).default;

case 'Stay Updated On Our Shopping.json':
data = (await import('@demo/templates/Stay Updated On Our Shopping.json')).default;
break;

case 'Stay Updated On Our Shopping.json':
data = (await import("@demo/templates/Stay Updated On Our Shopping.json")).default;

case 'We Serve Healthy & Delicious Foods.json':
data = (await import('@demo/templates/We Serve Healthy & Delicious Foods.json'))
.default;
break;
case 'We Serve Healthy & Delicious Foods.json':
data = (await import("@demo/templates/We Serve Healthy & Delicious Foods.json")).default;

case `St. Patrick's Day - Newsletter.json`:
data = (await import(`@demo/templates/St. Patrick Day - Newsletter.json`)).default;
break;

}
return data;
}


50 changes: 39 additions & 11 deletions demo/src/config/templates.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
[
{
"path": "St. Patrick's Day - Newsletter.json",
"article_id": 902,
"title": "Arturia - Newsletter",
"summary": "Nice to meet you!",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/84a89d8e-4a57-47d5-b1be-e31e28d63222.png",
"category_id": 96,
"origin_source": "",
"readcount": 67,
"user_id": 107,
"secret": 0,
"level": 10,
"created_at": 1645697464,
"updated_at": 1645865828,
"deleted_at": 0,
"tags": [
{
"tag_id": 74,
"name": "券包",
"picture": "",
"desc": "券包",
"created_at": 1576227276,
"user_id": 77,
"updated_at": 0,
"deleted_at": 0
}
]
},
{
"path": "Arturia - Newsletter.json",
"article_id": 802,
"title": "Arturia - Newsletter",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665841839/dkvwaqds8orsiykqfv4v.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/77ee66f2-e268-4b53-b0f3-15864fdfbfbb.png",
"category_id": 96,
"origin_source": "",
"readcount": 67,
Expand Down Expand Up @@ -32,7 +60,7 @@
"article_id": 834,
"title": "Dynamic rendering",
"summary": "Dynamic rendering",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665841894/p28xhbvd9vpv9vvlpiwv.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/cae2b095-1326-4212-b241-2b6a32442efe.png",
"category_id": 96,
"origin_source": "",
"readcount": 24,
Expand Down Expand Up @@ -60,7 +88,7 @@
"article_id": 472,
"title": "Welcome to Easy-email",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665841928/ewhs1dr58uzpnbkhptoh.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/9e400248-84ea-453c-beea-e7120b340f3c.png",
"category_id": 90,
"origin_source": "",
"readcount": 897,
Expand Down Expand Up @@ -88,7 +116,7 @@
"article_id": 807,
"title": "MJML Code - Newsletter",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665841967/rboronq6oqhc3j7fq1uh.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/de4d139c-a137-479f-99f1-80c971eb69b2.png",
"category_id": 96,
"origin_source": "",
"readcount": 14,
Expand Down Expand Up @@ -116,7 +144,7 @@
"article_id": 775,
"title": "Racoon - Ecommerce",
"summary": "PRETEXT",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842164/djyunilp4oyr3rqg6zbk.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/821cbaa1-ebcf-476e-acc2-bb97a1edd316.png",
"category_id": 96,
"origin_source": "",
"readcount": 235,
Expand Down Expand Up @@ -144,7 +172,7 @@
"article_id": 622,
"title": "Welcome to Easy-email",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842195/tbn0jsmgayehjnr9wdtu.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/b6540c00-7f56-46e6-aa65-48f163a177c9.png",
"category_id": 90,
"origin_source": "",
"readcount": 538,
Expand Down Expand Up @@ -172,7 +200,7 @@
"article_id": 817,
"title": "Shop - Newsletter",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842024/d0gcpdxmhgq8cxjc2au8.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/871a3262-0390-487d-968b-b7800c672877.png",
"category_id": 96,
"origin_source": "",
"readcount": 24,
Expand Down Expand Up @@ -200,7 +228,7 @@
"article_id": 815,
"title": "Sphero - Newsletter",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842049/utuqjatvppwzrk3oly2l.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/48cb976e-1632-4318-82c5-44427e385ff5.png",
"category_id": 96,
"origin_source": "",
"readcount": 11,
Expand Down Expand Up @@ -228,7 +256,7 @@
"article_id": 814,
"title": "Star Wars",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842095/atlr93hgxcgks6zaijpy.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/6a9469b5-f515-44de-b3dd-466319134a1c.png",
"category_id": 96,
"origin_source": "",
"readcount": 12,
Expand Down Expand Up @@ -256,7 +284,7 @@
"article_id": 618,
"title": "Welcome to Easy-email",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842220/cyql3c3yiqt2qjnkepcg.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/1484a2b2-fdfc-47cb-a0cd-68d6dae49605.png",
"category_id": 90,
"origin_source": "",
"readcount": 142,
Expand Down Expand Up @@ -284,7 +312,7 @@
"article_id": 605,
"title": "Welcome to Easy-email",
"summary": "Nice to meet you!",
"picture": "http://res.cloudinary.com/dwkp0e1yo/image/upload/v1665842140/tsbeocrf9ukehnlluvlu.png",
"picture": "https://d3k81ch9hvuctc.cloudfront.net/company/S7EvMw/images/5f5dad1b-4ad5-4a03-a6ef-b1f051dbfce7.png",
"category_id": 90,
"origin_source": "",
"readcount": 590,
Expand Down
Loading

1 comment on commit 3a6c06a

@vercel
Copy link

@vercel vercel bot commented on 3a6c06a Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

easy-email – ./

easy-email-git-master-m-ryan.vercel.app
easy-email-m-ryan.vercel.app
email.maocanhua.cn

Please sign in to comment.