Skip to content

Commit

Permalink
🚸Simplify email style.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieutu committed Nov 6, 2024
1 parent c1d5a09 commit 6dfd880
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
23 changes: 3 additions & 20 deletions src/components/Contact/ContactEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,23 @@ const bodyStyle: CSSProperties = {
boxSizing: 'border-box',
fontFamily: '-apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Helvetica, Arial, sans-serif, \'Apple Color Emoji\', \'Segoe UI Emoji\', \'Segoe UI Symbol\'',
WebkitTextSizeAdjust: 'none',
backgroundColor: '#edf2f7',
color: '#718096',
height: '100%',
lineHeight: '1.4',
margin: 'auto',
paddingBottom: '16px',
width: '100% !important',
maxWidth: '600px',
} as const

const wrapperStyle: CSSProperties = {
backgroundColor: '#ffffff',
padding: '1px 16px',
borderRadius: '10px',
} as const

const messageStyle : CSSProperties = {
borderRadius: '10px',
border: 'solid 1px #edf2f7',
padding: '1px 8px',
whiteSpace: 'pre-line',
}

export const ContactEmail: Email<ContactFields> = (contact) => ({
subject: 'Un nouveau message de ReSaP !',
body: (
<body style={bodyStyle}>
<h1 style={{ textAlign: 'center' }}>ReSaP</h1>
<div style={wrapperStyle}>
<div>
<p>Bonjour,</p>

<p>Un nouveau message a été envoyé depuis le formulaire de contact de ReSap :</p>
<p />
<ul>
<ul style={{padding: 0}}>

Check failure on line 25 in src/components/Contact/ContactEmail.tsx

View workflow job for this annotation

GitHub Actions / checks

A space is required after '{'

Check failure on line 25 in src/components/Contact/ContactEmail.tsx

View workflow job for this annotation

GitHub Actions / checks

A space is required before '}'
{contact.firstName ? <li><b>Prénom</b> : {contact.firstName}</li> : null}
{contact.lastName ? <li><b>Nom</b> : {contact.lastName}</li> : null}
{contact.email ? (
Expand All @@ -53,7 +36,7 @@ export const ContactEmail: Email<ContactFields> = (contact) => ({
</li>
) : null}
{contact.organization ? <li><b>Structure</b> : {contact.organization}</li> : null}
<li style={{ marginTop: '7px' }}><b>Message</b> : <div style={messageStyle}>{contact.message}</div></li>
<div style={{marginTop: '1em'}}>{contact.message}</div>

Check failure on line 39 in src/components/Contact/ContactEmail.tsx

View workflow job for this annotation

GitHub Actions / checks

A space is required after '{'

Check failure on line 39 in src/components/Contact/ContactEmail.tsx

View workflow job for this annotation

GitHub Actions / checks

A space is required before '}'
</ul>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Contact/ContactFormSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Form = () => {
<div className="sm:col-span-6">
<div className="flex justify-between">
<label htmlFor="message" className={classNames(errors.message && 'text-red-500', 'block text-sm font-medium text-gray-700')}>
Message
Message*
</label>
{errors.message && (
<span className="text-sm text-red-500">
Expand Down
2 changes: 1 addition & 1 deletion src/services/mailer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const mailer = Mailer({
},
},
defaults: {
from: { name: 'Resap', address: 'noreply@resap.org' },
from: { name: 'Resap', address: 'noreply@resap.fr' },
},
}, {
ContactEmail,
Expand Down

0 comments on commit 6dfd880

Please sign in to comment.