diff --git a/.env.sample b/.env.sample index 41a41e2..27f082a 100644 --- a/.env.sample +++ b/.env.sample @@ -2,12 +2,12 @@ PORT=3005 # name of the app that sends the emails - featured in the message subject or body -APP_NAME=Tired.bike -APP_URL=https://tired.bike +APP_NAME=SolidCouch +APP_URL=https://app.solidcouch.org # provide path to a logo to display on top of emails - keep it small! # absolute path, or relative path to the base of the project APP_LOGO=./logo.png -SUPPORT_EMAIL=support@tired.bike +SUPPORT_EMAIL=support@solidcouch.org # server base url, e.g. to construct correct email verification link # this is the base url that end users see @@ -42,7 +42,7 @@ SMTP_TRANSPORT_AUTH_PASS= SMTP_TRANSPORT_REQUIRE_TLS= # email address which will be the sender of the notifications and email verification messages -EMAIL_SENDER=noreply@notifications.tired.bike +EMAIL_SENDER=noreply@notifications.solidcouch.org # JWT # path to JWT (private) key diff --git a/LICENSE b/LICENSE index c5ba3d9..727c733 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 Tired Bike +Copyright (c) 2023 SolidCouch contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/logo.png b/logo.png index d054466..260b364 100644 Binary files a/logo.png and b/logo.png differ diff --git a/src/config/index.ts b/src/config/index.ts index 5c7b5e4..c51fa81 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -14,14 +14,15 @@ export const baseUrl = ? `http://localhost:${port}` : process.env.BASE_URL -export const appName = process.env.APP_NAME ?? 'Tired.bike' +export const appName = process.env.APP_NAME ?? 'SolidCouch' -export const appUrl = process.env.APP_URL ?? 'https://tired.bike' +export const appUrl = process.env.APP_URL ?? 'https://app.solidcouch.org' -// default is tired.bike logo +// default is SolidCouch logo export const appLogo = process.env.APP_LOGO ?? './logo.png' -export const supportEmail = process.env.SUPPORT_EMAIL ?? 'support@tired.bike' +export const supportEmail = + process.env.SUPPORT_EMAIL ?? 'support@solidcouch.org' // identity under which the mailer is operating export const mailerCredentials = { @@ -56,7 +57,7 @@ export const smtpTransportOptions: SMTPTransport.Options = { // email address which will be the sender of the notifications and email verification messages export const emailSender = - process.env.EMAIL_SENDER ?? 'noreply@notifications.tired.bike' + process.env.EMAIL_SENDER ?? 'noreply@notifications.solidcouch.org' // email verification expiration in seconds (1 hour) export const emailVerificationExpiration = 3600 diff --git a/src/controllers/notification.ts b/src/controllers/notification.ts index 00b777e..70cbcb0 100644 --- a/src/controllers/notification.ts +++ b/src/controllers/notification.ts @@ -1,5 +1,5 @@ import { DefaultContext, Middleware } from 'koa' -import { appName, emailSender } from '../config/index.js' +import { appName, appUrl, emailSender } from '../config/index.js' import { sendMail } from '../services/mailerService.js' import { generateHtmlMessage } from '../templates/generateMessage.js' import { getVerifiedEmails } from './status.js' @@ -48,6 +48,10 @@ export const notification: Middleware< html: await generateHtmlMessage('message', { ...body, title: subject, + chatLink: new URL( + `messages?with=${encodeURIComponent(body.actor.id)}`, + appUrl, + ).toString(), }), text: body.object.content, }) diff --git a/src/services/mailerService.ts b/src/services/mailerService.ts index f623a3d..3b46b65 100644 --- a/src/services/mailerService.ts +++ b/src/services/mailerService.ts @@ -11,7 +11,7 @@ export const sendMail = async (options: SendMailOptions) => { { filename: path.basename(appLogo), path: appLogo, - cid: 'applogo@tired.bike', + cid: 'applogo@solidcouch.org', }, ...(options.attachments ?? []), ], diff --git a/src/templates/layout.hbs b/src/templates/layout.hbs index 38b5160..5cc6ba6 100644 --- a/src/templates/layout.hbs +++ b/src/templates/layout.hbs @@ -6,7 +6,7 @@
Hello{{#if target.name}} {{/if}}{{target.name}}!
- {{#if + {{#if actor.name }}{{actor.name}}{{else}}Somebody{{/if}} sent you a message from @@ -10,9 +10,5 @@
{{object.content}}\ No newline at end of file