Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send email about LessOnline #9223

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft

Send email about LessOnline #9223

wants to merge 18 commits into from

Conversation

Raemon
Copy link
Collaborator

@Raemon Raemon commented May 3, 2024

┆Issue is synchronized with this Asana task by Unito

throw new Error("No site name configured. Make sure \"title\" is set in your settings.json.");
}
const taggedSubject = `[${sitename}] ${subject}`;
// const sitename = forumTitleSetting.get();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be an optional flag added to the function, rather than an in-place change.

@@ -78,7 +78,8 @@ export const getSiteUrl = function (): string {
if (url.slice(-1) !== '/') {
url += '/';
}
return url;
// return url;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to change the siteUrlSetting (the siteUrl instance setting) and leave a comment in the script itself that it needs to be changed to avoid sending out urls with localhost in them

@@ -279,24 +279,25 @@ function validateSheets(sheetsRegistry: typeof SheetsRegistry)
const enableDevelopmentEmailsSetting = new DatabaseServerSetting<boolean>('enableDevelopmentEmails', false)
async function sendEmail(renderedEmail: RenderedEmail): Promise<boolean>
{
if (process.env.NODE_ENV === 'production' || enableDevelopmentEmailsSetting.get()) {

// if (process.env.NODE_ENV === 'production' || enableDevelopmentEmailsSetting.get()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commenting this out is unnecessary; you can just append --production to yarn start-prod-db

await wrapAndSendEmail({
user: user,
subject: "LessOnline: A Festival of Truth-Seeking and Blogging (May 31 — Jun 2, Berkeley CA)",
body: LessOnlineEmail()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's any reason to make this a function if it's always returning the same thing

// const users = await Users.find({
// lastNotificationsCheck: {$gt: new Date("2020-01-01")},
// $or: [{ banned: { $exists: false } }, { banned: { $lte: new Date() } }],
// karma: {$gte: 0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget deleted: false, and then also { sort: { createdAt: 1 } } in the options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants