Skip to content

Commit

Permalink
fix(create-jsx-email): use linked email template, correct button props
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Oct 5, 2024
1 parent dddb76e commit 5b4f6d3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 103 deletions.
20 changes: 11 additions & 9 deletions assets/templates/email.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,12 @@ const anchor = {
};

const button = {
backgroundColor: '#777',
borderRadius: '5px',
color: '#fff',
display: 'block',
fontSize: '16px',
fontWeight: 'bold',
textAlign: 'center' as const,
textDecoration: 'none',
width: '100%',
padding: '10px'
};

export const previewProps = {
export const defaultProps = {
email: 'batman@example.com',
name: 'Bruce Wayne'
} as TemplateProps;
Expand All @@ -74,7 +67,16 @@ export const Template = ({ email, name }{{ propsType }}) => (
<Container style={container}>
<Section style={box}>
<Text style={paragraph}>This is our email body text</Text>
<Button style={button} href="https://example.com">
<Button
style={button}
href="https://example.com"
width={'100%'}
align={'center'}
backgroundColor={'#777'}
borderRadius={5}
fontSize={16}
textColor={'#fff'}
>
Action Button
</Button>
<Hr style={hr} />
Expand Down
1 change: 1 addition & 0 deletions packages/create-jsx-email/generators/templates
94 changes: 0 additions & 94 deletions packages/create-jsx-email/generators/templates/email.mustache

This file was deleted.

6 changes: 6 additions & 0 deletions packages/create-jsx-email/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tasks:
deps:
- ~:tsc
- ~:copy
- ~:copy.templates
options:
runDepsInParallel: false

Expand All @@ -36,6 +37,11 @@ tasks:
options:
cache: false

copy.templates:
command: rm -rf dist/generators/templates && cp -r ../../assets/templates dist/generators
options:
cache: false

tsc:
command: tsc --project tsconfig.json
inputs:
Expand Down

0 comments on commit 5b4f6d3

Please sign in to comment.