bugfix smtp secure variable, simplify telemetry

This commit is contained in:
Matthias Nannt
2022-08-24 21:31:27 +02:00
parent 246698ca02
commit a0ed5b7c0c
3 changed files with 3 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ export const sendEmail = async (emailData: sendEmailData) => {
let transporter = nodemailer.createTransport({
host: serverRuntimeConfig.smtpHost,
port: serverRuntimeConfig.smtpPort,
secure: serverRuntimeConfig.smtpSecureEnabled || false, // true for 465, false for other ports
secure: serverRuntimeConfig.smtpSecureEnabled, // true for 465, false for other ports
auth: {
user: serverRuntimeConfig.smtpUser,
pass: serverRuntimeConfig.smtpPassword,
@@ -56,4 +56,4 @@ export const sendVerificationEmail = async (user) => {
<br/>
Your snoopForms Team`,
});
};
};

View File

@@ -11,7 +11,6 @@ const { serverRuntimeConfig } = getConfig();
export const sendTelemetry = (event: string) => {
if (
process.env.NODE_ENV === "production" &&
serverRuntimeConfig.nextauthUrl !== "http://localhost:3000" &&
!serverRuntimeConfig.telemetryDisabled
) {

View File

@@ -12,7 +12,7 @@ const nextConfig = {
smtpPort: process.env.SMTP_PORT,
smtpUser: process.env.SMTP_USER,
smtpPassword: process.env.SMTP_PASSWORD,
smtpSecureEnabled: process.env.SMTP_SECURE_ENABLED,
smtpSecureEnabled: process.env.SMTP_SECURE_ENABLED === "1",
posthogApiHost: process.env.POSTHOG_API_HOST,
posthogApiKey: process.env.POSTHOG_API_KEY,
telemetryDisabled: process.env.TELEMETRY_DISABLED === "1",