Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Fix invite and recovery email style

François Zaninotto0563c9d089e1
diff --git a/package-lock.json b/package-lock.json
index 1e5f24c9..3d3bc26a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -23,7 +23,7 @@
"papaparse": "^5.4.1",
"prop-types": "^15.8.1",
"ra-data-fakerest": "^5.1.1",
- "ra-supabase": "^3.1.0",
+ "ra-supabase": "^3.1.1",
"react": "^18.2.0",
"react-admin": "^5.1.0",
"react-cropper": "^2.3.3",
@@ -10570,19 +10570,19 @@
}
},
"node_modules/ra-supabase": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/ra-supabase/-/ra-supabase-3.1.0.tgz",
- "integrity": "sha512-T+OtQ4FTYcJqWUdgZ5rcLamHbU2Ae0BqMEuBLry9sXPUFOtsh26+zShFRe6mtkbJA2ydjfiYW01/n5SQrWP2eg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/ra-supabase/-/ra-supabase-3.1.1.tgz",
+ "integrity": "sha512-zakFSYvepH4iCzst8NKe00y/T5R1LOv32nV1FhFXf1xKQxG48RoiZC6DACBmJxWJT1syJRpTxoBuIStXKaL+BA==",
"dependencies": {
- "ra-supabase-core": "^3.1.0",
- "ra-supabase-language-english": "^3.1.0",
- "ra-supabase-ui-materialui": "^3.1.0"
+ "ra-supabase-core": "^3.1.1",
+ "ra-supabase-language-english": "^3.1.1",
+ "ra-supabase-ui-materialui": "^3.1.1"
}
},
"node_modules/ra-supabase-core": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/ra-supabase-core/-/ra-supabase-core-3.1.0.tgz",
- "integrity": "sha512-KagSKm+fJLkQTtNc7OtejktXMIysv80ZgOzJAM5nz+xyHNVhFb2GEbW+AvYI3uXejay/cQL8WvfQkczl/NeZ7Q==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/ra-supabase-core/-/ra-supabase-core-3.1.1.tgz",
+ "integrity": "sha512-4DMt2o155tpBoBhWmjKuOPHMQZTl4Sa/8Y0kgPxPDEJx+mx803OwGP+XW3Z0dUe7xivdkXI05Z9qj+kJCLWx8Q==",
"peerDependencies": {
"@raphiniert/ra-data-postgrest": "^2.3.0",
"@supabase/supabase-js": "^2.0.0",
@@ -10590,16 +10590,16 @@
}
},
"node_modules/ra-supabase-language-english": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/ra-supabase-language-english/-/ra-supabase-language-english-3.1.0.tgz",
- "integrity": "sha512-9/S8n6quJeJiOcFVLDZQNqXOMcGnlwmdZ+Xy4UFGcfdsGCuPr68CYxdG68WnP1jxyo7Hy7b/zvfr+Zu5rW8f+g=="
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/ra-supabase-language-english/-/ra-supabase-language-english-3.1.1.tgz",
+ "integrity": "sha512-fA6DZYwvjv2lZLTX0r96vHIH3LoBkTFuIfqeuimXDxsFeztGAtC5svlEKrTlOb4NZsij0FkDar16kBmUe2XiUg=="
},
"node_modules/ra-supabase-ui-materialui": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/ra-supabase-ui-materialui/-/ra-supabase-ui-materialui-3.1.0.tgz",
- "integrity": "sha512-F/6JfoBEwW4wAZ/0b8ccJ/EqjGR460+ermU1HuGxXXj5YCd9Gg6Oc+YDcKlSZ7F0bH16DI9Q8z08EXns6cvyQw==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/ra-supabase-ui-materialui/-/ra-supabase-ui-materialui-3.1.1.tgz",
+ "integrity": "sha512-F4xdVxkSR3KPHqwTfduGDFN7tOkYd0egLuUy7UnymOvrWPqkSgFZekd5Q9H6xWBZiVdDPcz17urlycPdU5JCSQ==",
"dependencies": {
- "ra-supabase-core": "^3.1.0"
+ "ra-supabase-core": "^3.1.1"
},
"peerDependencies": {
"@mui/icons-material": "^5.0.0",
diff --git a/package.json b/package.json
index c304b0dd..326eea18 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"papaparse": "^5.4.1",
"prop-types": "^15.8.1",
"ra-data-fakerest": "^5.1.1",
- "ra-supabase": "^3.1.0",
+ "ra-supabase": "^3.1.1",
"react": "^18.2.0",
"react-admin": "^5.1.0",
"react-cropper": "^2.3.3",
diff --git a/src/sales/SalesCreate.tsx b/src/sales/SalesCreate.tsx
index 64526090..42b66644 100644
--- a/src/sales/SalesCreate.tsx
+++ b/src/sales/SalesCreate.tsx
@@ -25,10 +25,15 @@ export function SalesCreate() {
return dataProvider.salesCreate(data);
},
onSuccess: () => {
+ notify(
+ 'User created. They will soon receive an email to set their password.'
+ );
redirect('/sales');
},
onError: () => {
- notify('An error occurred. Please try again.');
+ notify('An error occurred while creating the user.', {
+ type: 'error',
+ });
},
});
const onSubmit: SubmitHandler<SalesFormData> = async data => {
@@ -47,7 +52,7 @@ export function SalesCreate() {
<Container maxWidth="sm" sx={{ mt: 4 }}>
<Card>
<SimpleForm onSubmit={onSubmit as SubmitHandler<any>}>
- <Typography variant="h6">Create sale person</Typography>
+ <Typography variant="h6">Create a new user</Typography>
<SalesInputs />
</SimpleForm>
</Card>
diff --git a/supabase/config.toml b/supabase/config.toml
index 668e7385..79d46835 100644
--- a/supabase/config.toml
+++ b/supabase/config.toml
@@ -92,11 +92,11 @@ double_confirm_changes = true
enable_confirmations = false
[auth.email.template.invite]
-subject = "You've been invited to use Atomic CRM"
+subject = "You've been invited to Atomic CRM"
content_path = "./supabase/templates/invite.html"
[auth.email.template.recovery]
-subject = "Reset Password"
+subject = "Reset your Atomic CRM Password"
content_path = "./supabase/templates/recovery.html"
[auth.sms]
diff --git a/supabase/templates/invite.html b/supabase/templates/invite.html
index 7cb5fbc1..5f53082e 100644
--- a/supabase/templates/invite.html
+++ b/supabase/templates/invite.html
@@ -40,7 +40,7 @@
padding: 10px;
text-align: center;
background-color: #007bff;
- color: #ffffff;
+ color: #ffffff !important;
text-decoration: none;
border-radius: 5px;
}
@@ -52,18 +52,21 @@
<h2>Confirm your account</h2>
</div>
<div class="content">
- <p>Welcome to Atomic CRM.</p>
+ <p>Hello {{ .Data.first_name }},</p>
<p>
- You've been invited to join the CRM organization. Confirm
- your address below:
+ You've been invited to join Atomic CRM. To confirm your
+ account and choose your password, please click the link
+ below.
+ </p>
+ <p>
+ <a
+ href="{{ .ConfirmationURL }}auth-callback.html"
+ class="button"
+ >Create my account</a
+ >
</p>
- <a
- href="{{ .ConfirmationURL }}auth-callback.html"
- class="button"
- >Confirm my account</a
- >
<p>See you soon!</p>
- <p>Atomic CRM team</p>
+ <p>The Atomic CRM team</p>
</div>
</div>
</body>
diff --git a/supabase/templates/recovery.html b/supabase/templates/recovery.html
index ee603807..0965bdd2 100644
--- a/supabase/templates/recovery.html
+++ b/supabase/templates/recovery.html
@@ -40,7 +40,7 @@
padding: 10px;
text-align: center;
background-color: #007bff;
- color: #ffffff;
+ color: #ffffff !important;
text-decoration: none;
border-radius: 5px;
}
@@ -53,18 +53,24 @@
</div>
<div class="content">
<p>Hello,</p>
- <p>To reset your password, follow the link below:</p>
- <a
- href="{{ .ConfirmationURL }}auth-callback.html"
- class="button"
- >Reset my password</a
- >
<p>
- <strong>Warning:</strong> If the password reset request did
- not originate from you, please contact us immediately as
- this may be a fraudulent attempt.
+ We've received a request to reset the password for the
+ Atomic CRM account associated with the email {{ .Email }}.
+ No changes have been made to your account yet.
</p>
- <p>Atomic CRM</p>
+ <p>You can reset your password by clicking the button below.</p>
+ <p>
+ <a
+ href="{{ .ConfirmationURL }}auth-callback.html"
+ class="button"
+ >Reset your password</a
+ >
+ </p>
+ <p>
+ If you did not request a new password, please contact the
+ Atomic CRM administrator immediately.
+ </p>
+ <p>The Atomic CRM team</p>
</div>
</div>
</body>