Skip to content

feat: clean up email generation#298

Merged
limesdotpink merged 15 commits intodevfrom
dev-feature-better-mailer
Nov 15, 2025
Merged

feat: clean up email generation#298
limesdotpink merged 15 commits intodevfrom
dev-feature-better-mailer

Conversation

@limesdotpink
Copy link
Member

@limesdotpink limesdotpink commented Nov 10, 2025

Resolves #297

Changes:

Rewrote the email generation code to be easier to use and a lot more flexible. Also slightly edited the email styles.

Constructing and sending an email is as easy as this:

const email = new CreateEmail()
	.addHeader('Hello {{pnid}}!', { pnid: pnid.username })
	.addParagraph('Your <strong>Pretendo Network ID</strong> activation is almost complete. Please click the link below to confirm your e-mail address and complete the activation process.')
	.addButton('Confirm email address', `https://api.pretendo.cc/v1/email/verify?token=${pnid.identification.email_token}`)
	.addParagraph('You may also enter the following 6-digit code on your console:')
	.addButton(pnid.identification.email_code, '', false)
	.addParagraph('We hope you have fun using our services!')
	.addParagraph('Here\'s a paragraph with [multiple links](https://example.org). Hope [you](https://github.com) enjoy it!');

const options = {
	to: pnid.email.address,
	subject: '[Pretendo Network] Please confirm your email address',
	email
};

await sendMail(options);
image image

@limesdotpink
Copy link
Member Author

requesting a review from these two, but ofc anyone is welcome to review this

@limesdotpink
Copy link
Member Author

ok should be actually ready now!

@limesdotpink limesdotpink force-pushed the dev-feature-better-mailer branch from 1e2a86d to a0bde95 Compare November 11, 2025 00:32
Copy link
Member

@jonbarrow jonbarrow left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for knocking this out 👍 just one small comment

In the future I wonder if it would be better to use something like https://jsx.email for emails rather than trying to hand-roll it ourselves, but that's a topic for a future day. This is definitely a big improvement over what we had before

@limesdotpink
Copy link
Member Author

Looks good to me, thanks for knocking this out 👍 just one small comment

In the future I wonder if it would be better to use something like https://jsx.email for emails rather than trying to hand-roll it ourselves, but that's a topic for a future day. This is definitely a big improvement over what we had before

That's a good point, though to be honest idk how helpful that would be now that I've implemented this. But yeah, probably good to talk about that in a decade or so, when email clients will support html from the 2010s. probably.

@limesdotpink limesdotpink force-pushed the dev-feature-better-mailer branch from 743ba49 to 17b294e Compare November 12, 2025 04:19
@limesdotpink
Copy link
Member Author

I guess @mrjvs if this looks good to you or will then it can be merged?

jonbarrow
jonbarrow previously approved these changes Nov 14, 2025
Copy link
Member

@jonbarrow jonbarrow left a comment

Choose a reason for hiding this comment

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

LGTM

@jonbarrow
Copy link
Member

I'm sorry I lied, @gitlimes can you also bump the nodemailer version and make sure everything still works? That way we can also close #201 at the same time as this (it's a major version bump so I want to make sure there's no breaking changes)

@limesdotpink
Copy link
Member Author

nodemailer? i hardly know 'er!

(yeah i can do that)

@limesdotpink
Copy link
Member Author

nodemailer? i hardly know 'er!

(yeah i can do that)

in case @mrjvs reads this: jon is gonna test this himself with the actual config we use on the website. this pr should be ready to review whenever, for real this time.

Copy link
Contributor

@mrjvs mrjvs left a comment

Choose a reason for hiding this comment

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

Lgtm

@limesdotpink limesdotpink merged commit 564b137 into dev Nov 15, 2025
7 checks passed
@limesdotpink limesdotpink deleted the dev-feature-better-mailer branch November 15, 2025 20:30
@limesdotpink limesdotpink mentioned this pull request Nov 18, 2025
4 tasks
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.

[Bug]: the PNID deletion email is broken

3 participants