cal/next.config.js
Alex van Andel cf3713d3a1 Implemented mailing for Calendso instances
added two templates, confirm-booked (sent to invitee) and new-event (sent to agent, for the time being only when no calendar integrations exist).
2021-05-27 22:10:20 +00:00

40 lines
1.3 KiB
JavaScript

const withTM = require('next-transpile-modules')(['react-timezone-select']);
if ( ! process.env.EMAIL_FROM ) {
console.warn('\x1b[33mwarn', '\x1b[0m', 'EMAIL_FROM environment variable is not set, this may indicate mailing is currently disabled. Please refer to the .env.example file.');
}
const validJson = (jsonString) => {
try {
const o = JSON.parse(jsonString);
if (o && typeof o === "object") {
return o;
}
}
catch (e) {}
return false;
}
if (process.env.GOOGLE_API_CREDENTIALS && ! validJson(process.env.GOOGLE_API_CREDENTIALS)) {
console.warn('\x1b[33mwarn', '\x1b[0m', "- Disabled 'Google Calendar' integration. Reason: Invalid value for GOOGLE_API_CREDENTIALS environment variable. When set, this value needs to contain valid JSON like {\"web\":{\"client_id\":\"<clid>\",\"client_secret\":\"<secret>\",\"redirect_uris\":[\"<yourhost>/api/integrations/googlecalendar/callback>\"]}. You can download this JSON from your OAuth Client @ https://console.cloud.google.com/apis/credentials.");
}
module.exports = withTM({
future: {
webpack5: true,
},
typescript: {
ignoreBuildErrors: true,
},
async redirects() {
return [
{
source: '/settings',
destination: '/settings/profile',
permanent: true,
}
]
}
});