Ocelot-Social/backend/src/emails/__snapshots__/sendRegistrationMail.spec.ts.snap
Wolfgang Huß d9a7c1adc5
feat(backend): improve e-mail deliverability with sender name (#8888)
* Avoid early html encoding for the remaining '='

* Make 'EMAIL_DEFAULT_SENDER' required env

* Implement sender and recipient name on send e-mails nodemailer conform

* Fix e-mail snapshots
2025-09-13 11:39:39 +00:00

620 lines
18 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`sendRegistrationMail with invite code English renders correctly 1`] = `
{
"attachments": [],
"from": {
"address": "devops@ocelot.social",
"name": "ocelot.social",
},
"html": "<!DOCTYPE html>
<html lang="en">
<head>
<meta content="multipart/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.wf-force-outline-none[tabindex="-1"]:focus{outline:none;}</style>
<style>body{
display: block;
font-family: Lato, sans-serif;
font-size: 16px;
text-align: left;
text-align: -webkit-left;
line-height: 24px;
justify-content: center;
padding: 15px;
margin: 0px;
}
h2 {
margin-top: 25px;
margin-bottom: 30px;
font-size: 24px;
font-weight: normal;
line-height: 24px;
color: #333333;
}
.container {
max-width: 680px;
margin: 0 auto;
display: block;
}
.head-logo {
width: 30%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 50px;
}
p.no-margin-top-bottom {
margin-top: 0;
margin-bottom: 0;
}
a {
color: #17b53e;
}
a.button {
background: #17b53e;
font-family: Lato, sans-serif;
font-size: 16px;
text-decoration: none;
text-align:center;
padding: 9px 18px;
color: #ffffff;
display: table;
margin-left: auto;
margin-right: auto;
border-radius: 4px;
}
.text-block {
margin-top: 20px;
color: #000000;
}
footer {
padding: 20px;
font-family: Lato, sans-serif;
font-size: 14px;
line-height: 15px;
text-align: center;
color: #888888;
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="head"><img class="head-logo" alt="Welcome Image" loading="lazy" src="http://webapp:3000/img/custom/logo-squared.svg">
</div>
</header>
<h2>Welcome to ocelot.social!</h2>
<div class="wrapper">
<div class="content"></div>
<p>Thank you for joining our cause it's awesome to have you on board. There's just one tiny step missing before we can start shaping the world together … Please confirm your e-mail address by clicking the button below:</p><a class="button" href="http://webapp:3000/registration?email=moderator%40example.org&amp;nonce=123456&amp;inviteCode=welcome&amp;method=invite-code">Confirm your e-mail address</a>
<p>If the above button doesn't work, you can also copy the following code into your browser window: <span>123456</span></p>
<p>However, this only works if you have registered through our website.</p>
<p>If you didn't sign up for <a>ocelot.social</a> we recommend you to check it out! It's a social network from people for people who want to connect and change the world together.
</p>
<p>PS: If you ignore this e-mail we will not create an account for you. ;)</p>
<div class="text-block">
<p class="no-margin-top-bottom">See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p class="no-margin-top-bottom"> The ocelot.social Team</p>
</div>
</div>
<div class="support">
<p class="no-margin-top-bottom">If you have questions or problems, feel free to contact our support: <a href="mailto:devops@ocelot.social">devops@ocelot.social</a></p>
</div>
<footer>
<div class="footer"></div><a href="https://ocelot.social">ocelot.social Community</a>
</footer>
</div>
</body>
</html>",
"subject": "Welcome to ocelot.social",
"text": "WELCOME TO OCELOT.SOCIAL!
Thank you for joining our cause it's awesome to have you on board. There's
just one tiny step missing before we can start shaping the world together …
Please confirm your e-mail address by clicking the button below:
Confirm your e-mail address
[http://webapp:3000/registration?email=moderator%40example.org&nonce=123456&inviteCode=welcome&method=invite-code]
If the above button doesn't work, you can also copy the following code into your
browser window: 123456
However, this only works if you have registered through our website.
If you didn't sign up for ocelot.social we recommend you to check it out! It's a
social network from people for people who want to connect and change the world
together.
PS: If you ignore this e-mail we will not create an account for you. ;)
See you soon on ocelot.social [https://ocelot.social]!
The ocelot.social Team
If you have questions or problems, feel free to contact our support:
devops@ocelot.social [devops@ocelot.social]
ocelot.social Community [https://ocelot.social]",
"to": {
"address": "moderator@example.org",
"name": "Bob &"?@\\ Baumeister",
},
}
`;
exports[`sendRegistrationMail with invite code German renders correctly 1`] = `
{
"attachments": [],
"from": {
"address": "devops@ocelot.social",
"name": "ocelot.social",
},
"html": "<!DOCTYPE html>
<html lang="de">
<head>
<meta content="multipart/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.wf-force-outline-none[tabindex="-1"]:focus{outline:none;}</style>
<style>body{
display: block;
font-family: Lato, sans-serif;
font-size: 16px;
text-align: left;
text-align: -webkit-left;
line-height: 24px;
justify-content: center;
padding: 15px;
margin: 0px;
}
h2 {
margin-top: 25px;
margin-bottom: 30px;
font-size: 24px;
font-weight: normal;
line-height: 24px;
color: #333333;
}
.container {
max-width: 680px;
margin: 0 auto;
display: block;
}
.head-logo {
width: 30%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 50px;
}
p.no-margin-top-bottom {
margin-top: 0;
margin-bottom: 0;
}
a {
color: #17b53e;
}
a.button {
background: #17b53e;
font-family: Lato, sans-serif;
font-size: 16px;
text-decoration: none;
text-align:center;
padding: 9px 18px;
color: #ffffff;
display: table;
margin-left: auto;
margin-right: auto;
border-radius: 4px;
}
.text-block {
margin-top: 20px;
color: #000000;
}
footer {
padding: 20px;
font-family: Lato, sans-serif;
font-size: 14px;
line-height: 15px;
text-align: center;
color: #888888;
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="head"><img class="head-logo" alt="Welcome Image" loading="lazy" src="http://webapp:3000/img/custom/logo-squared.svg">
</div>
</header>
<h2>Willkommen bei ocelot.social!</h2>
<div class="wrapper">
<div class="content"></div>
<p>Danke, dass du dich angemeldet hast wir freuen uns, dich dabei zu haben. Jetzt fehlt nur noch eine Kleinigkeit, bevor wir gemeinsam die Welt verbessern können … Bitte bestätige deine E-Mail Adresse:</p><a class="button" href="http://webapp:3000/registration?email=moderator%40example.org&amp;nonce=123456&amp;inviteCode=welcome&amp;method=invite-code">Bestätige deine E-Mail Adresse</a>
<p>Sollte der Button für dich nicht funktionieren, kannst du auch folgenden Code in dein Browserfenster kopieren: <span>123456</span></p>
<p>Das funktioniert allerdings nur, wenn du dich über unsere Website registriert hast.</p>
<p>Falls du dich nicht selbst bei <a>ocelot.social</a> angemeldet hast, schau doch mal vorbei! Wir sind ein gemeinnütziges Aktionsnetzwerk von Menschen für Menschen.
</p>
<p>PS: Wenn du keinen Account bei uns möchtest, kannst du diese E-Mail einfach ignorieren. ;)</p>
<div class="text-block">
<p class="no-margin-top-bottom">Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p class="no-margin-top-bottom"> Dein ocelot.social Team</p>
</div>
</div>
<div class="support">
<p class="no-margin-top-bottom">Wenn du Fragen oder Probleme hast, kannst du dich gerne an den Support wenden: <a href="mailto:devops@ocelot.social">devops@ocelot.social</a></p>
</div>
<footer>
<div class="footer"></div><a href="https://ocelot.social">ocelot.social Community</a>
</footer>
</div>
</body>
</html>",
"subject": "Willkommen bei ocelot.social",
"text": "WILLKOMMEN BEI OCELOT.SOCIAL!
Danke, dass du dich angemeldet hast wir freuen uns, dich dabei zu haben. Jetzt
fehlt nur noch eine Kleinigkeit, bevor wir gemeinsam die Welt verbessern können
… Bitte bestätige deine E-Mail Adresse:
Bestätige deine E-Mail Adresse
[http://webapp:3000/registration?email=moderator%40example.org&nonce=123456&inviteCode=welcome&method=invite-code]
Sollte der Button für dich nicht funktionieren, kannst du auch folgenden Code in
dein Browserfenster kopieren: 123456
Das funktioniert allerdings nur, wenn du dich über unsere Website registriert
hast.
Falls du dich nicht selbst bei ocelot.social angemeldet hast, schau doch mal
vorbei! Wir sind ein gemeinnütziges Aktionsnetzwerk von Menschen für Menschen.
PS: Wenn du keinen Account bei uns möchtest, kannst du diese E-Mail einfach
ignorieren. ;)
Bis bald bei ocelot.social [https://ocelot.social]!
Dein ocelot.social Team
Wenn du Fragen oder Probleme hast, kannst du dich gerne an den Support wenden:
devops@ocelot.social [devops@ocelot.social]
ocelot.social Community [https://ocelot.social]",
"to": {
"address": "moderator@example.org",
"name": "Bob &"?@\\ Baumeister",
},
}
`;
exports[`sendRegistrationMail without invite code English renders correctly 1`] = `
{
"attachments": [],
"from": {
"address": "devops@ocelot.social",
"name": "ocelot.social",
},
"html": "<!DOCTYPE html>
<html lang="en">
<head>
<meta content="multipart/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.wf-force-outline-none[tabindex="-1"]:focus{outline:none;}</style>
<style>body{
display: block;
font-family: Lato, sans-serif;
font-size: 16px;
text-align: left;
text-align: -webkit-left;
line-height: 24px;
justify-content: center;
padding: 15px;
margin: 0px;
}
h2 {
margin-top: 25px;
margin-bottom: 30px;
font-size: 24px;
font-weight: normal;
line-height: 24px;
color: #333333;
}
.container {
max-width: 680px;
margin: 0 auto;
display: block;
}
.head-logo {
width: 30%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 50px;
}
p.no-margin-top-bottom {
margin-top: 0;
margin-bottom: 0;
}
a {
color: #17b53e;
}
a.button {
background: #17b53e;
font-family: Lato, sans-serif;
font-size: 16px;
text-decoration: none;
text-align:center;
padding: 9px 18px;
color: #ffffff;
display: table;
margin-left: auto;
margin-right: auto;
border-radius: 4px;
}
.text-block {
margin-top: 20px;
color: #000000;
}
footer {
padding: 20px;
font-family: Lato, sans-serif;
font-size: 14px;
line-height: 15px;
text-align: center;
color: #888888;
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="head"><img class="head-logo" alt="Welcome Image" loading="lazy" src="http://webapp:3000/img/custom/logo-squared.svg">
</div>
</header>
<h2>Welcome to ocelot.social!</h2>
<div class="wrapper">
<div class="content"></div>
<p>Thank you for joining our cause it's awesome to have you on board. There's just one tiny step missing before we can start shaping the world together … Please confirm your e-mail address by clicking the button below:</p><a class="button" href="http://webapp:3000/registration?email=moderator%40example.org&amp;nonce=123456&amp;method=invite-mail">Confirm your e-mail address</a>
<p>If the above button doesn't work, you can also copy the following code into your browser window: <span>123456</span></p>
<p>However, this only works if you have registered through our website.</p>
<p>If you didn't sign up for <a>ocelot.social</a> we recommend you to check it out! It's a social network from people for people who want to connect and change the world together.
</p>
<p>PS: If you ignore this e-mail we will not create an account for you. ;)</p>
<div class="text-block">
<p class="no-margin-top-bottom">See you soon on <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p class="no-margin-top-bottom"> The ocelot.social Team</p>
</div>
</div>
<div class="support">
<p class="no-margin-top-bottom">If you have questions or problems, feel free to contact our support: <a href="mailto:devops@ocelot.social">devops@ocelot.social</a></p>
</div>
<footer>
<div class="footer"></div><a href="https://ocelot.social">ocelot.social Community</a>
</footer>
</div>
</body>
</html>",
"subject": "Welcome to ocelot.social",
"text": "WELCOME TO OCELOT.SOCIAL!
Thank you for joining our cause it's awesome to have you on board. There's
just one tiny step missing before we can start shaping the world together …
Please confirm your e-mail address by clicking the button below:
Confirm your e-mail address
[http://webapp:3000/registration?email=moderator%40example.org&nonce=123456&method=invite-mail]
If the above button doesn't work, you can also copy the following code into your
browser window: 123456
However, this only works if you have registered through our website.
If you didn't sign up for ocelot.social we recommend you to check it out! It's a
social network from people for people who want to connect and change the world
together.
PS: If you ignore this e-mail we will not create an account for you. ;)
See you soon on ocelot.social [https://ocelot.social]!
The ocelot.social Team
If you have questions or problems, feel free to contact our support:
devops@ocelot.social [devops@ocelot.social]
ocelot.social Community [https://ocelot.social]",
"to": {
"address": "moderator@example.org",
"name": "Bob &"?@\\ Baumeister",
},
}
`;
exports[`sendRegistrationMail without invite code German renders correctly 1`] = `
{
"attachments": [],
"from": {
"address": "devops@ocelot.social",
"name": "ocelot.social",
},
"html": "<!DOCTYPE html>
<html lang="de">
<head>
<meta content="multipart/html; charset=UTF-8" http-equiv="content-type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>.wf-force-outline-none[tabindex="-1"]:focus{outline:none;}</style>
<style>body{
display: block;
font-family: Lato, sans-serif;
font-size: 16px;
text-align: left;
text-align: -webkit-left;
line-height: 24px;
justify-content: center;
padding: 15px;
margin: 0px;
}
h2 {
margin-top: 25px;
margin-bottom: 30px;
font-size: 24px;
font-weight: normal;
line-height: 24px;
color: #333333;
}
.container {
max-width: 680px;
margin: 0 auto;
display: block;
}
.head-logo {
width: 30%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 50px;
}
p.no-margin-top-bottom {
margin-top: 0;
margin-bottom: 0;
}
a {
color: #17b53e;
}
a.button {
background: #17b53e;
font-family: Lato, sans-serif;
font-size: 16px;
text-decoration: none;
text-align:center;
padding: 9px 18px;
color: #ffffff;
display: table;
margin-left: auto;
margin-right: auto;
border-radius: 4px;
}
.text-block {
margin-top: 20px;
color: #000000;
}
footer {
padding: 20px;
font-family: Lato, sans-serif;
font-size: 14px;
line-height: 15px;
text-align: center;
color: #888888;
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="head"><img class="head-logo" alt="Welcome Image" loading="lazy" src="http://webapp:3000/img/custom/logo-squared.svg">
</div>
</header>
<h2>Willkommen bei ocelot.social!</h2>
<div class="wrapper">
<div class="content"></div>
<p>Danke, dass du dich angemeldet hast wir freuen uns, dich dabei zu haben. Jetzt fehlt nur noch eine Kleinigkeit, bevor wir gemeinsam die Welt verbessern können … Bitte bestätige deine E-Mail Adresse:</p><a class="button" href="http://webapp:3000/registration?email=moderator%40example.org&amp;nonce=123456&amp;method=invite-mail">Bestätige deine E-Mail Adresse</a>
<p>Sollte der Button für dich nicht funktionieren, kannst du auch folgenden Code in dein Browserfenster kopieren: <span>123456</span></p>
<p>Das funktioniert allerdings nur, wenn du dich über unsere Website registriert hast.</p>
<p>Falls du dich nicht selbst bei <a>ocelot.social</a> angemeldet hast, schau doch mal vorbei! Wir sind ein gemeinnütziges Aktionsnetzwerk von Menschen für Menschen.
</p>
<p>PS: Wenn du keinen Account bei uns möchtest, kannst du diese E-Mail einfach ignorieren. ;)</p>
<div class="text-block">
<p class="no-margin-top-bottom">Bis bald bei <a class="organization" href="https://ocelot.social">ocelot.social</a>!</p>
<p class="no-margin-top-bottom"> Dein ocelot.social Team</p>
</div>
</div>
<div class="support">
<p class="no-margin-top-bottom">Wenn du Fragen oder Probleme hast, kannst du dich gerne an den Support wenden: <a href="mailto:devops@ocelot.social">devops@ocelot.social</a></p>
</div>
<footer>
<div class="footer"></div><a href="https://ocelot.social">ocelot.social Community</a>
</footer>
</div>
</body>
</html>",
"subject": "Willkommen bei ocelot.social",
"text": "WILLKOMMEN BEI OCELOT.SOCIAL!
Danke, dass du dich angemeldet hast wir freuen uns, dich dabei zu haben. Jetzt
fehlt nur noch eine Kleinigkeit, bevor wir gemeinsam die Welt verbessern können
… Bitte bestätige deine E-Mail Adresse:
Bestätige deine E-Mail Adresse
[http://webapp:3000/registration?email=moderator%40example.org&nonce=123456&method=invite-mail]
Sollte der Button für dich nicht funktionieren, kannst du auch folgenden Code in
dein Browserfenster kopieren: 123456
Das funktioniert allerdings nur, wenn du dich über unsere Website registriert
hast.
Falls du dich nicht selbst bei ocelot.social angemeldet hast, schau doch mal
vorbei! Wir sind ein gemeinnütziges Aktionsnetzwerk von Menschen für Menschen.
PS: Wenn du keinen Account bei uns möchtest, kannst du diese E-Mail einfach
ignorieren. ;)
Bis bald bei ocelot.social [https://ocelot.social]!
Dein ocelot.social Team
Wenn du Fragen oder Probleme hast, kannst du dich gerne an den Support wenden:
devops@ocelot.social [devops@ocelot.social]
ocelot.social Community [https://ocelot.social]",
"to": {
"address": "moderator@example.org",
"name": "Bob &"?@\\ Baumeister",
},
}
`;