Skip to content

Commit 3a77b92

Browse files
authored
fix: point reply link to current app route (#12)
additionally: - change default branding to SolidCouch - update LICENSE attribution
1 parent d9830f9 commit 3a77b92

File tree

8 files changed

+20
-19
lines changed

8 files changed

+20
-19
lines changed

.env.sample

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
PORT=3005
33

44
# name of the app that sends the emails - featured in the message subject or body
5-
APP_NAME=Tired.bike
6-
APP_URL=https://tired.bike
5+
APP_NAME=SolidCouch
6+
APP_URL=https://app.solidcouch.org
77
# provide path to a logo to display on top of emails - keep it small!
88
# absolute path, or relative path to the base of the project
99
APP_LOGO=./logo.png
10-
SUPPORT_EMAIL=support@tired.bike
10+
SUPPORT_EMAIL=support@solidcouch.org
1111

1212
# server base url, e.g. to construct correct email verification link
1313
# this is the base url that end users see
@@ -42,7 +42,7 @@ SMTP_TRANSPORT_AUTH_PASS=
4242
SMTP_TRANSPORT_REQUIRE_TLS=
4343

4444
# email address which will be the sender of the notifications and email verification messages
45-
EMAIL_SENDER=noreply@notifications.tired.bike
45+
EMAIL_SENDER=noreply@notifications.solidcouch.org
4646

4747
# JWT
4848
# path to JWT (private) key

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2023 Tired Bike
3+
Copyright (c) 2023 SolidCouch contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

logo.png

-2.34 KB
Loading

src/config/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ export const baseUrl =
1414
? `http://localhost:${port}`
1515
: process.env.BASE_URL
1616

17-
export const appName = process.env.APP_NAME ?? 'Tired.bike'
17+
export const appName = process.env.APP_NAME ?? 'SolidCouch'
1818

19-
export const appUrl = process.env.APP_URL ?? 'https://tired.bike'
19+
export const appUrl = process.env.APP_URL ?? 'https://app.solidcouch.org'
2020

21-
// default is tired.bike logo
21+
// default is SolidCouch logo
2222
export const appLogo = process.env.APP_LOGO ?? './logo.png'
2323

24-
export const supportEmail = process.env.SUPPORT_EMAIL ?? 'support@tired.bike'
24+
export const supportEmail =
25+
process.env.SUPPORT_EMAIL ?? 'support@solidcouch.org'
2526

2627
// identity under which the mailer is operating
2728
export const mailerCredentials = {
@@ -56,7 +57,7 @@ export const smtpTransportOptions: SMTPTransport.Options = {
5657

5758
// email address which will be the sender of the notifications and email verification messages
5859
export const emailSender =
59-
process.env.EMAIL_SENDER ?? 'noreply@notifications.tired.bike'
60+
process.env.EMAIL_SENDER ?? 'noreply@notifications.solidcouch.org'
6061

6162
// email verification expiration in seconds (1 hour)
6263
export const emailVerificationExpiration = 3600

src/controllers/notification.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DefaultContext, Middleware } from 'koa'
2-
import { appName, emailSender } from '../config/index.js'
2+
import { appName, appUrl, emailSender } from '../config/index.js'
33
import { sendMail } from '../services/mailerService.js'
44
import { generateHtmlMessage } from '../templates/generateMessage.js'
55
import { getVerifiedEmails } from './status.js'
@@ -48,6 +48,10 @@ export const notification: Middleware<
4848
html: await generateHtmlMessage('message', {
4949
...body,
5050
title: subject,
51+
chatLink: new URL(
52+
`messages?with=${encodeURIComponent(body.actor.id)}`,
53+
appUrl,
54+
).toString(),
5155
}),
5256
text: body.object.content,
5357
})

src/services/mailerService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const sendMail = async (options: SendMailOptions) => {
1111
{
1212
filename: path.basename(appLogo),
1313
path: appLogo,
14-
cid: 'applogo@tired.bike',
14+
cid: 'applogo@solidcouch.org',
1515
},
1616
...(options.attachments ?? []),
1717
],

src/templates/layout.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<body>
77
<header><img
88
alt='logo of {{appName}}'
9-
src='cid:applogo@tired.bike'
9+
src='cid:applogo@solidcouch.org'
1010
height='32'
1111
/></header>
1212
{{{body}}}

src/templates/message.hbs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p>Hello{{#if target.name}}&nbsp;{{/if}}{{target.name}}!</p>
22
<p>
3-
<a href={{actor.id}}>{{#if
3+
<a href='{{actor.id}}'>{{#if
44
actor.name
55
}}{{actor.name}}{{else}}Somebody{{/if}}</a>
66
sent you a message from
@@ -10,9 +10,5 @@
1010
<blockquote>{{object.content}}</blockquote>
1111

1212
<p>
13-
<a
14-
href='https://tired.bike/messages/{{encodeURIComponent actor.id}}'
15-
class='action-button'
16-
>Reply on
17-
{{appName}}</a>
13+
<a href='{{chatLink}}' class='action-button'>Reply on {{appName}}</a>
1814
</p>

0 commit comments

Comments
 (0)