diff --git a/server/src/http/controllers/Authentication.js b/server/src/http/controllers/Authentication.js
index 9dfa1b78f..70f37d0af 100644
--- a/server/src/http/controllers/Authentication.js
+++ b/server/src/http/controllers/Authentication.js
@@ -179,6 +179,23 @@ export default {
});
Logger.log('info', 'New tenant has been created.', { organizationId });
+ const filePath = path.join(global.rootPath, 'views/mail/Welcome.html');
+ const template = fs.readFileSync(filePath, 'utf8');
+ const rendered = Mustache.render(template, { ...form });
+ const mailOptions = {
+ to: userInsert.email,
+ from: `${process.env.MAIL_FROM_NAME} ${process.env.MAIL_FROM_ADDRESS}`,
+ subject: 'Welcome to Bigcapital',
+ html: rendered,
+ };
+ mail.sendMail(mailOptions, (error) => {
+ if (error) {
+ Logger.log('error', 'Failed send welcome mail', { error, form });
+ return;
+ }
+ Logger.log('info', 'User has been sent welcome email successfuly.', { form });
+ });
+
return res.status(200).send({
organization_id: organizationId,
});
diff --git a/server/src/http/controllers/FinancialStatements.js b/server/src/http/controllers/FinancialStatements.js
index e8340d00f..4366d9a74 100644
--- a/server/src/http/controllers/FinancialStatements.js
+++ b/server/src/http/controllers/FinancialStatements.js
@@ -13,7 +13,6 @@ export default {
router() {
const router = express.Router();
- // router.use('/journal', JournalController);
router.use('/balance_sheet', BalanceSheetController.router());
router.use('/profit_loss_sheet', ProfitLossController.router());
router.use('/general_ledger', GeneralLedgerController.router());
@@ -22,4 +21,4 @@ export default {
return router;
},
-}
+};
diff --git a/server/src/http/controllers/InviteUsers.js b/server/src/http/controllers/InviteUsers.js
index 8d741a75d..325a86dce 100644
--- a/server/src/http/controllers/InviteUsers.js
+++ b/server/src/http/controllers/InviteUsers.js
@@ -93,15 +93,17 @@ export default {
const template = fs.readFileSync(filePath, 'utf8');
const rendered = Mustache.render(template, {
- url: `${req.protocol}://${req.hostname}/invite/accept/${invite.token}`,
+ acceptUrl: `${req.protocol}://${req.hostname}/invite/accept/${invite.token}`,
fullName: `${user.firstName} ${user.lastName}`,
+ firstName: user.firstName,
+ lastName: user.lastName,
email: user.email,
- organizationName: organizationOptions.getMeta('organization_meta'),
+ organizationName: organizationOptions.getMeta('organization_name'),
});
const mailOptions = {
to: user.email,
from: `${process.env.MAIL_FROM_NAME} ${process.env.MAIL_FROM_ADDRESS}`,
- subject: `${user.firstName} ${user.lastName} has invited you to join a Bigcapital`,
+ subject: `${user.fullName} has invited you to join a Bigcapital`,
html: rendered,
};
mail.sendMail(mailOptions, (error) => {
diff --git a/server/views/mail/ResetPassword.html b/server/views/mail/ResetPassword.html
index ea7014c3c..1bdc23ffc 100644
--- a/server/views/mail/ResetPassword.html
+++ b/server/views/mail/ResetPassword.html
@@ -1,286 +1,427 @@
-
-
- Moosher Reset Password
-
+
+
+
+
+
+ Bigcapital | Reset your password
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- Reset Your Password
-
-
-
-
- Hi {{ first_name }} {{ last_name }},
- Click On The link blow to reset your password.
- Reset Password
-
-
-
-
- If you did not make this request, please contact us or ignore this message.
- This is an automatically generated email please do not reply to
- this email. If you face any issues, please contact us at {{ contact_us_email }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ bigcapital
+
+
+
+
+
+
Reset Your Password
+
+ Hi {{ first_name }} {{ last_name }},
+ Click On The link blow to reset your password.
+
+
+ If you did not make this request, please contact us or ignore this message.
+
+ This is an automatically generated email please do not reply to
+ this email. If you face any issues, please contact us at {{ contact_us_email }}
+
+
+
+
+
-
+
+
+
-
+
+
+
-
\ No newline at end of file
+
+
+
+
+
+
+