Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: await resend email

Brad Barbin277507f002c5
diff --git a/apps/erp/app/routes/x+/users+/customers.new.tsx b/apps/erp/app/routes/x+/users+/customers.new.tsx
index 1e1112913b..5846067597 100644
--- a/apps/erp/app/routes/x+/users+/customers.new.tsx
+++ b/apps/erp/app/routes/x+/users+/customers.new.tsx
@@ -61,7 +61,7 @@ export async function action({ request }: ActionFunctionArgs) {
throw new Error("Failed to load company or user");
}
- resend.emails.send({
+ const invitationEmail = await resend.emails.send({
from: "CarbonOS <[email protected]>",
to: result.email,
subject: `You have been invited to join ${company.data?.name} on CarbonOS`,
@@ -81,6 +81,8 @@ export async function action({ request }: ActionFunctionArgs) {
),
});
+ console.log(invitationEmail);
+
if (customerRedirect) {
throw redirect(
path.to.customerContacts(customerRedirect),
diff --git a/apps/erp/app/routes/x+/users+/employees.new.tsx b/apps/erp/app/routes/x+/users+/employees.new.tsx
index 3c971dfa0e..6e2983bb64 100644
--- a/apps/erp/app/routes/x+/users+/employees.new.tsx
+++ b/apps/erp/app/routes/x+/users+/employees.new.tsx
@@ -85,7 +85,7 @@ export async function action({ request }: ActionFunctionArgs) {
throw new Error("Failed to load company or user");
}
- resend.emails.send({
+ const invitationEmail = await resend.emails.send({
from: "CarbonOS <[email protected]>",
to: email,
subject: `You have been invited to join ${company.data?.name} on CarbonOS`,
@@ -105,6 +105,8 @@ export async function action({ request }: ActionFunctionArgs) {
),
});
+ console.log(invitationEmail);
+
throw redirect(
path.to.personJob(result.userId),
await flash(request, success("Successfully invited employee"))
diff --git a/apps/erp/app/routes/x+/users+/resend-invite.tsx b/apps/erp/app/routes/x+/users+/resend-invite.tsx
index 6be7367ffe..0d499f8813 100644
--- a/apps/erp/app/routes/x+/users+/resend-invite.tsx
+++ b/apps/erp/app/routes/x+/users+/resend-invite.tsx
@@ -64,7 +64,7 @@ export async function action({ request }: ActionFunctionArgs) {
);
}
- resend.emails.send({
+ const invitationEmail = await resend.emails.send({
from: "CarbonOS <[email protected]>",
to: user.data.email,
subject: `You have been invited to join ${company.data?.name} on CarbonOS`,
@@ -84,6 +84,8 @@ export async function action({ request }: ActionFunctionArgs) {
),
});
+ console.log(invitationEmail);
+
return json(
{},
await flash(request, success("Successfully resent invite"))
diff --git a/apps/erp/app/routes/x+/users+/suppliers.new.tsx b/apps/erp/app/routes/x+/users+/suppliers.new.tsx
index 283498c2dd..f583d9f6f4 100644
--- a/apps/erp/app/routes/x+/users+/suppliers.new.tsx
+++ b/apps/erp/app/routes/x+/users+/suppliers.new.tsx
@@ -61,7 +61,7 @@ export async function action({ request }: ActionFunctionArgs) {
throw new Error("Failed to load company or user");
}
- resend.emails.send({
+ const invitationEmail = await resend.emails.send({
from: "CarbonOS <[email protected]>",
to: result.email,
subject: `You have been invited to join ${company.data?.name} on CarbonOS`,
@@ -81,6 +81,8 @@ export async function action({ request }: ActionFunctionArgs) {
),
});
+ console.log(invitationEmail);
+
if (supplierRedirect) {
throw redirect(
path.to.supplierContacts(supplierRedirect),
diff --git a/apps/erp/app/trigger/user-admin.ts b/apps/erp/app/trigger/user-admin.ts
index 8310a91a14..cd4fefe9de 100644
--- a/apps/erp/app/trigger/user-admin.ts
+++ b/apps/erp/app/trigger/user-admin.ts
@@ -76,7 +76,7 @@ export const userAdminTask = task({
};
}
- resend.emails.send({
+ const invitationEmail = await resend.emails.send({
from: "CarbonOS <[email protected]>",
to: user.data.email,
subject: `You have been invited to join ${company.data?.name} on CarbonOS`,
@@ -96,6 +96,8 @@ export const userAdminTask = task({
),
});
+ console.log(invitationEmail);
+
result = {
success: true,
message: `Successfully resent invite for ${payload.id}`,