fix(backend): fix user profile and group links in e-mails (#8512)

* Add e-mail .env settings

* Fix user profile and group links

* fix snapshots

---------

Co-authored-by: Moriz Wahl <moriz.wahl@gmx.de>
This commit is contained in:
Wolfgang Huß 2025-05-09 13:51:21 +02:00 committed by GitHub
parent 2278a9e311
commit b471a8f92b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 41 additions and 39 deletions

View File

@ -26,6 +26,8 @@ SMTP_DKIM_PRIVATKEY=
# SMTP_IGNORE_TLS=true # SMTP_IGNORE_TLS=true
# SMTP_USERNAME= # SMTP_USERNAME=
# SMTP_PASSWORD= # SMTP_PASSWORD=
# SMTP_MAX_CONNECTIONS=1
# SMTP_MAX_MESSAGES= 10
JWT_SECRET="b/&&7b78BF&fv/Vd" JWT_SECRET="b/&&7b78BF&fv/Vd"
JWT_EXPIRES="2y" JWT_EXPIRES="2y"

View File

@ -91,7 +91,7 @@ footer {
<h2>Hello chatReceiver,</h2> <h2>Hello chatReceiver,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p>you have received a new chat message from <a class="user" href="http://webapp:3000/user/chatSender/chatsender">chatSender</a>. <p>you have received a new chat message from <a class="user" href="http://webapp:3000/profile/chatSender/chatsender">chatSender</a>.
</p><a class="button" href="http://webapp:3000/chat">Show Chat</a> </p><a class="button" href="http://webapp:3000/chat">Show Chat</a>
<div class="text-block"> <div class="text-block">
<p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
@ -109,7 +109,7 @@ footer {
"text": "HELLO CHATRECEIVER, "text": "HELLO CHATRECEIVER,
you have received a new chat message from chatSender you have received a new chat message from chatSender
[http://webapp:3000/user/chatSender/chatsender]. [http://webapp:3000/profile/chatSender/chatsender].
Show Chat [http://webapp:3000/chat] Show Chat [http://webapp:3000/chat]
@ -218,7 +218,7 @@ footer {
<h2>Hallo chatReceiver,</h2> <h2>Hallo chatReceiver,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p>du hast eine neue Chat-Nachricht von <a class="user" href="http://webapp:3000/user/chatSender/chatsender">chatSender</a> erhalten. <p>du hast eine neue Chat-Nachricht von <a class="user" href="http://webapp:3000/profile/chatSender/chatsender">chatSender</a> erhalten.
</p><a class="button" href="http://webapp:3000/chat">Chat anzeigen</a> </p><a class="button" href="http://webapp:3000/chat">Chat anzeigen</a>
<div class="text-block"> <div class="text-block">
<p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
@ -236,7 +236,7 @@ footer {
"text": "HALLO CHATRECEIVER, "text": "HALLO CHATRECEIVER,
du hast eine neue Chat-Nachricht von chatSender du hast eine neue Chat-Nachricht von chatSender
[http://webapp:3000/user/chatSender/chatsender] erhalten. [http://webapp:3000/profile/chatSender/chatsender] erhalten.
Chat anzeigen [http://webapp:3000/chat] Chat anzeigen [http://webapp:3000/chat]

View File

@ -91,7 +91,7 @@ footer {
<h2>Hello Jenny Rostock,</h2> <h2>Hello Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p>your role in the group “The Group” has been changed. Click on the button to view this group:</p><a class="button" href="http://webapp:3000/group/g1/the-group">View group</a> <p>your role in the group “The Group” has been changed. Click on the button to view this group:</p><a class="button" href="http://webapp:3000/groups/g1/the-group">View group</a>
<div class="text-block"> <div class="text-block">
<p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p> The ocelot.social Team</p><br> <p> The ocelot.social Team</p><br>
@ -110,7 +110,7 @@ footer {
your role in the group “The Group” has been changed. Click on the button to view your role in the group “The Group” has been changed. Click on the button to view
this group: this group:
View group [http://webapp:3000/group/g1/the-group] View group [http://webapp:3000/groups/g1/the-group]
See you soon on ocelot.social [https://ocelot.social]! See you soon on ocelot.social [https://ocelot.social]!
@ -217,7 +217,7 @@ footer {
<h2>Hello Jenny Rostock,</h2> <h2>Hello Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> commented on a post that you are observing with the title “New Post”. Click on the button to view this comment: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> commented on a post that you are observing with the title “New Post”. Click on the button to view this comment:
</p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">View comment</a> </p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">View comment</a>
<div class="text-block"> <div class="text-block">
<p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
@ -234,9 +234,9 @@ footer {
"subject": "ocelot.social Notification: New comment on post", "subject": "ocelot.social Notification: New comment on post",
"text": "HELLO JENNY ROSTOCK, "text": "HELLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] commented on a post that Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] commented on a post
you are observing with the title “New Post”. Click on the button to view this that you are observing with the title “New Post”. Click on the button to view
comment: this comment:
View comment [http://webapp:3000/post/p1/new-post#commentId-c1] View comment [http://webapp:3000/post/p1/new-post#commentId-c1]
@ -473,7 +473,7 @@ footer {
<h2>Hello Jenny Rostock,</h2> <h2>Hello Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> mentioned you in a comment to the post with the title “New Post”. Click on the button to view this comment: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> mentioned you in a comment to the post with the title “New Post”. Click on the button to view this comment:
</p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">View comment</a> </p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">View comment</a>
<div class="text-block"> <div class="text-block">
<p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
@ -490,7 +490,7 @@ footer {
"subject": "ocelot.social Notification: Mentioned in comment", "subject": "ocelot.social Notification: Mentioned in comment",
"text": "HELLO JENNY ROSTOCK, "text": "HELLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] mentioned you in a Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] mentioned you in a
comment to the post with the title “New Post”. Click on the button to view this comment to the post with the title “New Post”. Click on the button to view this
comment: comment:
@ -977,8 +977,8 @@ footer {
<h2>Hello Jenny Rostock,</h2> <h2>Hello Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> joined the group “The Group”. Click on the button to view this group: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> joined the group “The Group”. Click on the button to view this group:
</p><a class="button" href="http://webapp:3000/group/g1/the-group">View group</a> </p><a class="button" href="http://webapp:3000/groups/g1/the-group">View group</a>
<div class="text-block"> <div class="text-block">
<p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p> The ocelot.social Team</p><br> <p> The ocelot.social Team</p><br>
@ -994,10 +994,10 @@ footer {
"subject": "ocelot.social Notification: User joined group", "subject": "ocelot.social Notification: User joined group",
"text": "HELLO JENNY ROSTOCK, "text": "HELLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] joined the group “The Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] joined the group “The
Group”. Click on the button to view this group: Group”. Click on the button to view this group:
View group [http://webapp:3000/group/g1/the-group] View group [http://webapp:3000/groups/g1/the-group]
See you soon on ocelot.social [https://ocelot.social]! See you soon on ocelot.social [https://ocelot.social]!
@ -1104,8 +1104,8 @@ footer {
<h2>Hello Jenny Rostock,</h2> <h2>Hello Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> left the group “The Group”. Click on the button to view this group: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> left the group “The Group”. Click on the button to view this group:
</p><a class="button" href="http://webapp:3000/group/g1/the-group">View group</a> </p><a class="button" href="http://webapp:3000/groups/g1/the-group">View group</a>
<div class="text-block"> <div class="text-block">
<p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p> The ocelot.social Team</p><br> <p> The ocelot.social Team</p><br>
@ -1121,10 +1121,10 @@ footer {
"subject": "ocelot.social Notification: User left group", "subject": "ocelot.social Notification: User left group",
"text": "HELLO JENNY ROSTOCK, "text": "HELLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] left the group “The Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] left the group “The
Group”. Click on the button to view this group: Group”. Click on the button to view this group:
View group [http://webapp:3000/group/g1/the-group] View group [http://webapp:3000/groups/g1/the-group]
See you soon on ocelot.social [https://ocelot.social]! See you soon on ocelot.social [https://ocelot.social]!
@ -1231,7 +1231,7 @@ footer {
<h2>Hallo Jenny Rostock,</h2> <h2>Hallo Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p>deine Rolle in der Gruppe „The Group“ wurde geändert. Klicke auf den Knopf, um diese Gruppe zu sehen:</p><a class="button" href="http://webapp:3000/group/g1/the-group">Gruppe ansehen</a> <p>deine Rolle in der Gruppe „The Group“ wurde geändert. Klicke auf den Knopf, um diese Gruppe zu sehen:</p><a class="button" href="http://webapp:3000/groups/g1/the-group">Gruppe ansehen</a>
<div class="text-block"> <div class="text-block">
<p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p> Dein ocelot.social Team</p><br> <p> Dein ocelot.social Team</p><br>
@ -1250,7 +1250,7 @@ footer {
deine Rolle in der Gruppe „The Group“ wurde geändert. Klicke auf den Knopf, um deine Rolle in der Gruppe „The Group“ wurde geändert. Klicke auf den Knopf, um
diese Gruppe zu sehen: diese Gruppe zu sehen:
Gruppe ansehen [http://webapp:3000/group/g1/the-group] Gruppe ansehen [http://webapp:3000/groups/g1/the-group]
Bis bald bei ocelot.social [https://ocelot.social]! Bis bald bei ocelot.social [https://ocelot.social]!
@ -1357,7 +1357,7 @@ footer {
<h2>Hallo Jenny Rostock,</h2> <h2>Hallo Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> hat einen Beitrag den du beobachtest mit dem Titel „New Post“ kommentiert. Klicke auf den Knopf, um diesen Kommentar zu sehen: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> hat einen Beitrag den du beobachtest mit dem Titel „New Post“ kommentiert. Klicke auf den Knopf, um diesen Kommentar zu sehen:
</p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">Kommentar ansehen</a> </p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">Kommentar ansehen</a>
<div class="text-block"> <div class="text-block">
<p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
@ -1374,8 +1374,8 @@ footer {
"subject": "ocelot.social Benachrichtigung: Neuer Kommentar zu Beitrag", "subject": "ocelot.social Benachrichtigung: Neuer Kommentar zu Beitrag",
"text": "HALLO JENNY ROSTOCK, "text": "HALLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] hat einen Beitrag den du Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] hat einen Beitrag den
beobachtest mit dem Titel „New Post“ kommentiert. Klicke auf den Knopf, um du beobachtest mit dem Titel „New Post“ kommentiert. Klicke auf den Knopf, um
diesen Kommentar zu sehen: diesen Kommentar zu sehen:
Kommentar ansehen [http://webapp:3000/post/p1/new-post#commentId-c1] Kommentar ansehen [http://webapp:3000/post/p1/new-post#commentId-c1]
@ -1613,7 +1613,7 @@ footer {
<h2>Hallo Jenny Rostock,</h2> <h2>Hallo Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> hat dich in einem Kommentar zu dem Beitrag mit dem Titel „New Post“ erwähnt. Klicke auf den Knopf, um den Kommentar zu sehen: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> hat dich in einem Kommentar zu dem Beitrag mit dem Titel „New Post“ erwähnt. Klicke auf den Knopf, um den Kommentar zu sehen:
</p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">Kommentar ansehen</a> </p><a class="button" href="http://webapp:3000/post/p1/new-post#commentId-c1">Kommentar ansehen</a>
<div class="text-block"> <div class="text-block">
<p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
@ -1630,7 +1630,7 @@ footer {
"subject": "ocelot.social Benachrichtigung: Erwähnung in Kommentar", "subject": "ocelot.social Benachrichtigung: Erwähnung in Kommentar",
"text": "HALLO JENNY ROSTOCK, "text": "HALLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] hat dich in einem Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] hat dich in einem
Kommentar zu dem Beitrag mit dem Titel „New Post“ erwähnt. Klicke auf den Knopf, Kommentar zu dem Beitrag mit dem Titel „New Post“ erwähnt. Klicke auf den Knopf,
um den Kommentar zu sehen: um den Kommentar zu sehen:
@ -2117,8 +2117,8 @@ footer {
<h2>Hallo Jenny Rostock,</h2> <h2>Hallo Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> ist der Gruppe „The Group“ beigetreten. Klicke auf den Knopf, um diese Gruppe zu sehen: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> ist der Gruppe „The Group“ beigetreten. Klicke auf den Knopf, um diese Gruppe zu sehen:
</p><a class="button" href="http://webapp:3000/group/g1/the-group">Gruppe ansehen</a> </p><a class="button" href="http://webapp:3000/groups/g1/the-group">Gruppe ansehen</a>
<div class="text-block"> <div class="text-block">
<p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p> Dein ocelot.social Team</p><br> <p> Dein ocelot.social Team</p><br>
@ -2134,10 +2134,10 @@ footer {
"subject": "ocelot.social Benachrichtigung: Nutzer tritt Gruppe bei", "subject": "ocelot.social Benachrichtigung: Nutzer tritt Gruppe bei",
"text": "HALLO JENNY ROSTOCK, "text": "HALLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] ist der Gruppe „The Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] ist der Gruppe „The
Group“ beigetreten. Klicke auf den Knopf, um diese Gruppe zu sehen: Group“ beigetreten. Klicke auf den Knopf, um diese Gruppe zu sehen:
Gruppe ansehen [http://webapp:3000/group/g1/the-group] Gruppe ansehen [http://webapp:3000/groups/g1/the-group]
Bis bald bei ocelot.social [https://ocelot.social]! Bis bald bei ocelot.social [https://ocelot.social]!
@ -2244,8 +2244,8 @@ footer {
<h2>Hallo Jenny Rostock,</h2> <h2>Hallo Jenny Rostock,</h2>
<div class="wrapper"> <div class="wrapper">
<div class="content"></div> <div class="content"></div>
<p><a class="user" href="http://webapp:3000/user/u2/peter-lustig">Peter Lustig</a> hat die Gruppe „The Group“ verlassen. Klicke auf den Knopf, um diese Gruppe zu sehen: <p><a class="user" href="http://webapp:3000/profile/u2/peter-lustig">Peter Lustig</a> hat die Gruppe „The Group“ verlassen. Klicke auf den Knopf, um diese Gruppe zu sehen:
</p><a class="button" href="http://webapp:3000/group/g1/the-group">Gruppe ansehen</a> </p><a class="button" href="http://webapp:3000/groups/g1/the-group">Gruppe ansehen</a>
<div class="text-block"> <div class="text-block">
<p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p> <p>Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p> Dein ocelot.social Team</p><br> <p> Dein ocelot.social Team</p><br>
@ -2261,10 +2261,10 @@ footer {
"subject": "ocelot.social Benachrichtigung: Nutzer verlässt Gruppe", "subject": "ocelot.social Benachrichtigung: Nutzer verlässt Gruppe",
"text": "HALLO JENNY ROSTOCK, "text": "HALLO JENNY ROSTOCK,
Peter Lustig [http://webapp:3000/user/u2/peter-lustig] hat die Gruppe „The Peter Lustig [http://webapp:3000/profile/u2/peter-lustig] hat die Gruppe „The
Group“ verlassen. Klicke auf den Knopf, um diese Gruppe zu sehen: Group“ verlassen. Klicke auf den Knopf, um diese Gruppe zu sehen:
Gruppe ansehen [http://webapp:3000/group/g1/the-group] Gruppe ansehen [http://webapp:3000/groups/g1/the-group]
Bis bald bei ocelot.social [https://ocelot.social]! Bis bald bei ocelot.social [https://ocelot.social]!

View File

@ -115,7 +115,7 @@ export const sendNotificationMail = async (notification: any): Promise<OriginalM
commenterUrl: commenterUrl:
notification?.from?.__typename === 'Comment' notification?.from?.__typename === 'Comment'
? new URL( ? new URL(
`/user/${notification?.from?.author?.id}/${notification?.from?.author?.slug}`, `/profile/${notification?.from?.author?.id}/${notification?.from?.author?.slug}`,
CONFIG.CLIENT_URI, CONFIG.CLIENT_URI,
) )
: undefined, : undefined,
@ -131,7 +131,7 @@ export const sendNotificationMail = async (notification: any): Promise<OriginalM
groupUrl: groupUrl:
notification?.from?.__typename === 'Group' notification?.from?.__typename === 'Group'
? new URL( ? new URL(
`/group/${notification?.from?.id}/${notification?.from?.slug}`, `/groups/${notification?.from?.id}/${notification?.from?.slug}`,
CONFIG.CLIENT_URI, CONFIG.CLIENT_URI,
) )
: undefined, : undefined,
@ -142,7 +142,7 @@ export const sendNotificationMail = async (notification: any): Promise<OriginalM
groupRelatedUserUrl: groupRelatedUserUrl:
notification?.from?.__typename === 'Group' notification?.from?.__typename === 'Group'
? new URL( ? new URL(
`/user/${notification?.relatedUser?.id}/${notification?.relatedUser?.slug}`, `/profile/${notification?.relatedUser?.id}/${notification?.relatedUser?.slug}`,
CONFIG.CLIENT_URI, CONFIG.CLIENT_URI,
) )
: undefined, : undefined,
@ -176,7 +176,7 @@ export const sendChatMessageMail = async (
locale: recipientUser.locale, locale: recipientUser.locale,
name: recipientUser.name, name: recipientUser.name,
chattingUser: senderUser.name, chattingUser: senderUser.name,
chattingUserUrl: new URL(`/user/${senderUser.id}/${senderUser.slug}`, CONFIG.CLIENT_URI), chattingUserUrl: new URL(`/profile/${senderUser.id}/${senderUser.slug}`, CONFIG.CLIENT_URI),
chatUrl: new URL('/chat', CONFIG.CLIENT_URI), chatUrl: new URL('/chat', CONFIG.CLIENT_URI),
}, },
}) })