From 850a81935e443a7351ff0d209d9df4db7dc56793 Mon Sep 17 00:00:00 2001 From: Douglas Sanchez Date: Mon, 3 Jun 2019 14:29:49 -0400 Subject: [PATCH 1/3] Added new Dapp Created Email template. --- src/services/dappCreatedEmail.ts | 113 +++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 src/services/dappCreatedEmail.ts diff --git a/src/services/dappCreatedEmail.ts b/src/services/dappCreatedEmail.ts new file mode 100644 index 00000000..1603821e --- /dev/null +++ b/src/services/dappCreatedEmail.ts @@ -0,0 +1,113 @@ +export const dappCreatedEmail = ` + + + + + The DappBot Team + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +`; + +export default dappCreatedEmail; \ No newline at end of file From 2555e82b4d4c4b1f95a4439f248e34c1805e6374 Mon Sep 17 00:00:00 2001 From: John O'Sullivan Date: Mon, 3 Jun 2019 15:14:47 -0400 Subject: [PATCH 2/3] Updated dappCreatedEmail.ts to instead export a fxn returning desired HTML w/ vars filled in --- src/services/dappCreatedEmail.ts | 10 ++++++---- src/services/sendgrid.ts | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/services/dappCreatedEmail.ts b/src/services/dappCreatedEmail.ts index 1603821e..94b63820 100644 --- a/src/services/dappCreatedEmail.ts +++ b/src/services/dappCreatedEmail.ts @@ -1,4 +1,5 @@ -export const dappCreatedEmail = ` +export const createDappEmail = (dappname: string, dappDNS: string) => { + return ` @@ -48,7 +49,7 @@ width: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-co

Dapp Created!

-

Congratulations! You just created and deployed a Dapp. Use the link below to view and interact with your new Dapp.

+

Congratulations! You just created and deployed ${dappname}. Use the link below to view and interact with your new Dapp.

@@ -60,7 +61,7 @@ width: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-co
- {yourdapp.dapp.bot} + ${dappDNS}
@@ -109,5 +110,6 @@ width: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-co `; +} -export default dappCreatedEmail; \ No newline at end of file +export default createDappEmail; \ No newline at end of file diff --git a/src/services/sendgrid.ts b/src/services/sendgrid.ts index bff0bb3b..30ab97f2 100644 --- a/src/services/sendgrid.ts +++ b/src/services/sendgrid.ts @@ -1,5 +1,6 @@ import sgMail from '@sendgrid/mail'; import { sendgridApiKey } from '../env'; +import dappCreatedEmail from './dappCreatedEmail'; let USING_SENDGRID = false; @@ -16,7 +17,7 @@ function sendConfirmationMail(owner:string, dappname:string, dappDNS:string) { from : FROM_ADDRESS, to : owner, subject : `${dappname} generation complete!`, - text : `${dappname} generation has completed! You may now view your dapp at ${dappDNS}.` + html : dappCreatedEmail(dappname, dappDNS) } if (USING_SENDGRID){ return sgMail.send(confirmationParam); From f11a7cfaf9e8cb45760ed4501ffd35f8a385ab27 Mon Sep 17 00:00:00 2001 From: John O'Sullivan Date: Mon, 3 Jun 2019 15:16:29 -0400 Subject: [PATCH 3/3] Added quotes around href target --- src/services/dappCreatedEmail.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/dappCreatedEmail.ts b/src/services/dappCreatedEmail.ts index 94b63820..db8b7fd7 100644 --- a/src/services/dappCreatedEmail.ts +++ b/src/services/dappCreatedEmail.ts @@ -61,7 +61,7 @@ width: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-co
- ${dappDNS} + ${dappDNS}