-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new welcome template * pull over new templates * update snaps * Create silly-boats-mix.md * fix * code review * add new assets * trigger
- Loading branch information
1 parent
048cb32
commit d870690
Showing
80 changed files
with
1,730 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"mailing": patch | ||
"mailing-core": patch | ||
--- | ||
|
||
Add new Welcome template to emails. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"*.{js,jsx,ts,tsx}": "eslint --fix", | ||
"*.rb": "rubocop --autocorrect", | ||
"packages/cli/src/emails/**/*.{ts,tsx}": "scripts/generate-emails-js" | ||
"packages/cli/src/__mocks__/emails/**/*.{ts,tsx}": "scripts/generate-emails __mocks__/emails", | ||
"packages/cli/src/emails/**/*.{ts,tsx}": "scripts/generate-emails emails" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
121 changes: 121 additions & 0 deletions
121
packages/cli/src/__mocks__/emails-js/components/BaseLayout.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import React from "react"; | ||
import { | ||
Mjml, | ||
MjmlBody, | ||
MjmlHead, | ||
MjmlFont, | ||
MjmlStyle, | ||
MjmlAttributes, | ||
MjmlAll, | ||
MjmlRaw, | ||
MjmlPreview, | ||
} from "mjml-react"; | ||
import { colors, screens, themeDefaults, spacing } from "../theme"; | ||
|
||
export default function BaseLayout({ width, children, preview }) { | ||
return ( | ||
<Mjml> | ||
<MjmlHead> | ||
{preview && <MjmlPreview>{preview}</MjmlPreview>} | ||
<MjmlRaw> | ||
<meta name="color-scheme" content="light dark" /> | ||
<meta name="supported-color-schemes" content="light dark" /> | ||
</MjmlRaw> | ||
<MjmlFont | ||
name="Inter" | ||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700" | ||
/> | ||
<MjmlAttributes> | ||
<MjmlAll {...themeDefaults} /> | ||
</MjmlAttributes> | ||
<MjmlStyle>{` | ||
body { | ||
-webkit-font-smoothing: antialiased; | ||
} | ||
a { | ||
color: inherit | ||
} | ||
.gutter { | ||
padding-left: ${spacing.s7}px; | ||
padding-right: ${spacing.s7}px; | ||
} | ||
.no-wrap { | ||
white-space: nowrap; | ||
} | ||
.dark-mode { | ||
display: none; | ||
max-width: 0px; | ||
max-height: 0px; | ||
overflow: hidden; | ||
mso-hide: all; | ||
} | ||
.hidden { | ||
display: none; | ||
max-width: 0px; | ||
max-height: 0px; | ||
overflow: hidden; | ||
mso-hide: all; | ||
} | ||
.lg-hidden { | ||
display: none; | ||
max-width: 0px; | ||
max-height: 0px; | ||
overflow: hidden; | ||
mso-hide: all; | ||
} | ||
/* Large screens */ | ||
@media (min-width:${screens.xs}) { | ||
.lg-gutter { | ||
padding-left: ${spacing.s7}px !important; | ||
padding-right: ${spacing.s7}px !important; | ||
} | ||
.sm-hidden { | ||
display: none; | ||
max-width: 0px; | ||
max-height: 0px; | ||
overflow: hidden; | ||
mso-hide: all; | ||
} | ||
.lg-hidden { | ||
display: block !important; | ||
max-width: none !important; | ||
max-height: none !important; | ||
overflow: visible !important; | ||
mso-hide: none !important; | ||
} | ||
} | ||
/* Dark Mode */ | ||
@media (prefers-color-scheme: dark) { | ||
body { | ||
background: ${colors.black}; | ||
} | ||
.invert > * { | ||
filter: invert(1) !important; | ||
} | ||
.text > * { | ||
color: #fff !important; | ||
} | ||
.dark-mode { | ||
display: inherit !important; | ||
max-width: none !important; | ||
max-height: none !important; | ||
overflow: visible !important; | ||
mso-hide: none !important; | ||
} | ||
.light-mode { | ||
display: none; | ||
max-width: 0px; | ||
max-height: 0px; | ||
overflow: hidden; | ||
mso-hide: all; | ||
} | ||
} | ||
`}</MjmlStyle> | ||
</MjmlHead> | ||
|
||
<MjmlBody width={width}>{children}</MjmlBody> | ||
</Mjml> | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/cli/src/__mocks__/emails-js/components/Button.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import { MjmlButton } from "mjml-react"; | ||
import { colors, fontSize, borderRadius, lineHeight, spacing } from "../theme"; | ||
|
||
export default function Button(props) { | ||
return ( | ||
<> | ||
<MjmlButton | ||
lineHeight={lineHeight.tight} | ||
fontSize={fontSize.base} | ||
height={spacing.s8} | ||
align="left" | ||
backgroundColor={colors.black} | ||
color={colors.neutral100} | ||
borderRadius={borderRadius.base} | ||
cssClass="light-mode" | ||
{...props} | ||
/> | ||
<MjmlButton | ||
lineHeight={lineHeight.tight} | ||
fontSize={fontSize.base} | ||
height={spacing.s8} | ||
align="left" | ||
backgroundColor={colors.gold} | ||
color={colors.black} | ||
borderRadius={borderRadius.base} | ||
cssClass="dark-mode" | ||
{...props} | ||
/> | ||
</> | ||
); | ||
} |
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
packages/cli/src/__mocks__/emails-js/components/Footer.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from "react"; | ||
import { MjmlSection, MjmlColumn, MjmlText } from "mjml-react"; | ||
import { EMAIL_PREFERENCES_URL } from "mailing-core"; | ||
import { colors, fontSize, spacing } from "../theme"; | ||
|
||
export default function Footer({ includeUnsubscribe }) { | ||
return ( | ||
<MjmlSection cssClass="gutter"> | ||
<MjmlColumn> | ||
<MjmlText | ||
paddingTop={spacing.s9} | ||
paddingBottom={spacing.s10} | ||
fontSize={fontSize.sm} | ||
color={colors.neutral400} | ||
> | ||
© {new Date().getFullYear()} BookBook | ||
{includeUnsubscribe && ( | ||
<> | ||
· | ||
<a | ||
href={EMAIL_PREFERENCES_URL} | ||
target="_blank" | ||
rel="noreferrer" | ||
style={{ textDecoration: "none" }} | ||
> | ||
Unsubscribe | ||
</a> | ||
</> | ||
)} | ||
</MjmlText> | ||
</MjmlColumn> | ||
</MjmlSection> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/cli/src/__mocks__/emails-js/components/Header.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
import { MjmlSection, MjmlColumn, MjmlImage } from "mjml-react"; | ||
|
||
const Header = ({ loose }) => { | ||
return ( | ||
<MjmlSection padding={loose ? "48px 0 40px" : "48px 0 24px"}> | ||
<MjmlColumn> | ||
<MjmlImage | ||
padding="0 24px 0" | ||
width="49px" | ||
height="54px" | ||
align="center" | ||
src="https://s3.amazonaws.com/lab.campsh.com/bb-transparent%402x.png" | ||
cssClass="invert" | ||
/> | ||
</MjmlColumn> | ||
</MjmlSection> | ||
); | ||
}; | ||
export default Header; |
17 changes: 17 additions & 0 deletions
17
packages/cli/src/__mocks__/emails-js/components/Heading.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
import Text from "./Text"; | ||
import { fontFamily, lineHeight, fontWeight, fontSize } from "../theme"; | ||
|
||
const defaultProps = { | ||
fontFamily: fontFamily.sans, | ||
fontWeight: fontWeight.normal, | ||
lineHeight: lineHeight.tight, | ||
fontSize: fontSize.lg, | ||
}; | ||
export default function Heading(props) { | ||
return ( | ||
<Text {...defaultProps} {...props}> | ||
{props.children} | ||
</Text> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
import { MjmlText } from "mjml-react"; | ||
|
||
export default function Text({ children, maxWidth, ...props }) { | ||
if (maxWidth) { | ||
return ( | ||
<MjmlText {...props} cssClass="text"> | ||
<div style={{ maxWidth }}>{children}</div> | ||
</MjmlText> | ||
); | ||
} else | ||
return ( | ||
<MjmlText {...props} cssClass="text"> | ||
{children} | ||
</MjmlText> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import nodemailer from "nodemailer"; | ||
import { buildSendMail } from "mailing-core"; | ||
|
||
const transport = nodemailer.createTransport({ | ||
pool: true, | ||
host: "smtp.example.com", | ||
port: 465, | ||
secure: true, | ||
auth: { | ||
user: "username", | ||
pass: "password", | ||
}, | ||
}); | ||
const sendMail = buildSendMail({ | ||
transport, | ||
defaultFrom: "[email protected]", | ||
configPath: "./mailing.config.json", | ||
}); | ||
export default sendMail; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
d870690
There was a problem hiding this comment.
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:
mailing-dynamic-demo – ./
demo.mailing.run
mailing-dynamic-demo.vercel.app
mailing-dynamic-demo-sofn.vercel.app
mailing-dynamic-demo-git-main-sofn.vercel.app
d870690
There was a problem hiding this comment.
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:
web-emails – ./packages/web
mailing-web.vercel.app
emails.mailing.run
web-emails-git-main-sofn.vercel.app
web-emails-sofn.vercel.app
d870690
There was a problem hiding this comment.
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:
web – ./packages/web
www.mailing.run
web-git-main-sofn.vercel.app
web-rho-puce.vercel.app
web-sofn.vercel.app
mailing.run