Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/OpenSignServer/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import dotenv from 'dotenv';
dotenv.config();

export const cloudServerUrl = 'http://localhost:8080/app';
export const appName = process.env.APP_NAME || 'OpenSign™';
export function customAPIurl() {
const url = new URL(cloudServerUrl);
return url.pathname === '/api/app' ? url.origin + '/api' : url.origin;
Expand Down
8 changes: 4 additions & 4 deletions apps/OpenSignServer/cloud/parsefunction/SendMailOTPv1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { smtpenable, updateMailCount } from '../../Utils.js';
import { appName, smtpenable, updateMailCount } from '../../Utils.js';
async function getDocument(docId) {
try {
const query = new Parse.Query('contracts_Document');
Expand Down Expand Up @@ -28,12 +28,12 @@ async function sendMailOTPv1(request) {
const mailsender = smtpenable ? process.env.SMTP_USER_EMAIL : process.env.MAILGUN_SENDER;
try {
await Parse.Cloud.sendEmail({
from: 'Opensign™' + ' <' + mailsender + '>',
from: appName + ' <' + mailsender + '>',
recipient: recipient,
subject: 'Your OpenSign™ OTP',
subject: `Your ${appName} OTP`,
text: 'This email is a test.',
html:
"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body><div style='background-color:#f5f5f5;padding:20px'><div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'><div style='background-color:red;padding:2px;font-family:system-ui; background-color:#47a3ad;'> <p style='font-size:20px;font-weight:400;color:white;padding-left:20px',>OTP Verification</p></div><div style='padding:20px'><p style='font-family:system-ui;font-size:14px'>Your OTP for OpenSign™ verification is:</p><p style=' text-decoration: none; font-weight: bolder; color:blue;font-size:45px;margin:20px'>" +
`<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body><div style='background-color:#f5f5f5;padding:20px'><div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'><div style='background-color:red;padding:2px;font-family:system-ui; background-color:#47a3ad;'> <p style='font-size:20px;font-weight:400;color:white;padding-left:20px',>OTP Verification</p></div><div style='padding:20px'><p style='font-family:system-ui;font-size:14px'>Your OTP for ${appName} verification is:</p><p style=' text-decoration: none; font-weight: bolder; color:blue;font-size:45px;margin:20px'>` +
code +
'</p></div> </div> </div></body></html>',
});
Expand Down
2 changes: 1 addition & 1 deletion apps/OpenSignServer/files/verification_email.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<br />
<p><a href="{{{link}}}" style="background-color: lightskyblue; cursor: pointer; border-radius: 5px; padding: 10px; border-style: solid; border-width: 2px; text-decoration: none; font-weight: bolder; color:blue">Verify email</a></p>
<br />
<p><a href="https://www.opensignlabs.com">OpenSign™</a></p>
<p><a href="https://www.opensignlabs.com">{{appName}}</a></p>
</body>

</html>
2 changes: 1 addition & 1 deletion apps/OpenSignServer/files/verification_email_subject.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OpenSign™ Email Address Verification
{{appName}} Email Address Verification
13 changes: 4 additions & 9 deletions apps/OpenSignServer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { exec } from 'child_process';
import { createTransport } from 'nodemailer';
import { app as v1 } from './cloud/customRoute/v1/apiV1.js';
import { PostHog } from 'posthog-node';
import { cloudServerUrl, smtpenable, smtpsecure, useLocal } from './Utils.js';
import { appName, cloudServerUrl, smtpenable, smtpsecure, useLocal } from './Utils.js';
import { SSOAuth } from './auth/authadapter.js';
let fsAdapter;
if (useLocal !== 'true') {
Expand Down Expand Up @@ -102,7 +102,7 @@ export const config = {
verifyUserEmails: false,
publicServerURL: process.env.SERVER_URL || cloudServerUrl,
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Opensign',
appName: appName,
allowClientClassCreation: false,
allowExpiredAuthDataToken: false,
encodeParseObjectInCloudFunction: true,
Expand All @@ -112,7 +112,7 @@ export const config = {
module: 'parse-server-api-mail-adapter',
options: {
// The email address from which emails are sent.
sender: 'Opensign™' + ' <' + mailsender + '>',
sender: appName + ' <' + mailsender + '>',
// The email templates.
templates: {
// The template used by Parse Server to send an email for password
Expand Down Expand Up @@ -141,12 +141,7 @@ export const config = {
}
: {}),
filesAdapter: fsAdapter,
auth: {
google: {
enabled: true,
},
sso: SSOAuth,
},
auth: { google: { enabled: true }, sso: SSOAuth },
};
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
Expand Down