diff --git a/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap b/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap index 00ec365f0..0e4e4ba7c 100644 --- a/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap +++ b/backend/src/emails/__snapshots__/sendEmailVariants.test.ts.snap @@ -124,6 +124,10 @@ exports[`sendEmailVariants sendAccountActivationEmail result has the correct htm line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -160,7 +164,8 @@ If the validity of the link has already expired, you can have a new link sent to
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -295,6 +300,10 @@ exports[`sendEmailVariants sendAccountMultiRegistrationEmail calls "sendEmailTra line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -329,7 +338,8 @@ exports[`sendEmailVariants sendAccountMultiRegistrationEmail calls "sendEmailTra
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -464,6 +474,10 @@ exports[`sendEmailVariants sendAddedContributionMessageEmail result has the corr line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -495,7 +509,8 @@ exports[`sendEmailVariants sendAddedContributionMessageEmail result has the corr
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -630,6 +645,10 @@ exports[`sendEmailVariants sendContributionChangedByModeratorEmail result has th line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -662,7 +681,8 @@ exports[`sendEmailVariants sendContributionChangedByModeratorEmail result has th
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -797,6 +817,10 @@ exports[`sendEmailVariants sendContributionConfirmedEmail result has the correct line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -829,7 +853,8 @@ exports[`sendEmailVariants sendContributionConfirmedEmail result has the correct
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -964,6 +989,10 @@ exports[`sendEmailVariants sendContributionDeletedEmail result has the correct h line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -996,7 +1025,8 @@ exports[`sendEmailVariants sendContributionDeletedEmail result has the correct h
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -1131,6 +1161,10 @@ exports[`sendEmailVariants sendContributionDeniedEmail result has the correct ht line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -1163,7 +1197,8 @@ exports[`sendEmailVariants sendContributionDeniedEmail result has the correct ht
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -1298,6 +1333,10 @@ exports[`sendEmailVariants sendResetPasswordEmail result has the correct html as line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -1334,7 +1373,8 @@ If the validity of the link has already expired, you can have a new link sent to
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -1469,6 +1509,10 @@ exports[`sendEmailVariants sendTransactionLinkRedeemedEmail result has the corre line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -1501,7 +1545,8 @@ exports[`sendEmailVariants sendTransactionLinkRedeemedEmail result has the corre
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


@@ -1636,6 +1681,10 @@ exports[`sendEmailVariants sendTransactionReceivedEmail result has the correct h line-break: anywhere; margin-bottom: 40px; } +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} .slink { width: 150px; } @@ -1650,13 +1699,17 @@ exports[`sendEmailVariants sendTransactionReceivedEmail result has the correct h

Bibi Bloxberg has sent you 37.40 Gradido

Hello Peter Lustig,

-

You have just received 37.40 GDD from Bibi Bloxberg (bibi@bloxberg.de).

+

You have just received 37.40 GDD from Bibi Bloxberg (bibi@bloxberg.de). +

-

Transaction details

-
You can find transaction details in your Gradido account.
To account -
Please do not reply to this email.
-
+

Message

+
+
Du bist schon lustiger ;)
+
+
\\"chatbox\\"Reply +
+ To account

Kind regards,
your Gradido team

@@ -1667,7 +1720,8 @@ exports[`sendEmailVariants sendTransactionReceivedEmail result has the correct h
\\"facebook\\"\\"Telegram\\"\\"Twitter\\"\\"youtube\\"
-
If you have any further questions, please contact our support.
support@gradido.net\\"Gradido +
If you have any further questions, please contact our support.
support@gradido.net +
\\"Gradido
Impressum

Privacy Policy
Gradido-Akademie
Institut für Wirtschaftsbionik
Pfarrweg 2
74653 Künzelsau
Deutschland


diff --git a/backend/src/emails/sendEmailTranslated.ts b/backend/src/emails/sendEmailTranslated.ts index d61ff3339..f78ecf805 100644 --- a/backend/src/emails/sendEmailTranslated.ts +++ b/backend/src/emails/sendEmailTranslated.ts @@ -99,13 +99,18 @@ export const sendEmailTranslated = async ({ path: path.join(__dirname, 'templates/includes/youtube-icon.png'), cid: 'youtubeicon', }, + { + filename: 'chatbox-icon.png', + path: path.join(__dirname, 'templates/includes/chatbox-icon.png'), + cid: 'chatboxicon', + }, ], }, locals, // the 'locale' in here seems not to be used by 'email-template', because it doesn't work if the language isn't set before by 'i18n.setLocale' }) .catch((error: unknown) => { logger.error('Error sending notification email', error) - return false + return error }) return resultSend diff --git a/backend/src/emails/sendEmailVariants.test.ts b/backend/src/emails/sendEmailVariants.test.ts index aee479441..76705deb9 100644 --- a/backend/src/emails/sendEmailVariants.test.ts +++ b/backend/src/emails/sendEmailVariants.test.ts @@ -562,6 +562,7 @@ describe('sendEmailVariants', () => { lastName: 'Lustig', email: 'peter@lustig.de', language: 'en', + memo: 'Du bist schon lustiger ;)', senderFirstName: 'Bibi', senderLastName: 'Bloxberg', senderEmail: 'bibi@bloxberg.de', @@ -580,6 +581,7 @@ describe('sendEmailVariants', () => { firstName: 'Peter', lastName: 'Lustig', locale: 'en', + memo: 'Du bist schon lustiger ;)', senderFirstName: 'Bibi', senderLastName: 'Bloxberg', senderEmail: 'bibi@bloxberg.de', diff --git a/backend/src/emails/sendEmailVariants.ts b/backend/src/emails/sendEmailVariants.ts index 8bcc9accd..5276a473a 100644 --- a/backend/src/emails/sendEmailVariants.ts +++ b/backend/src/emails/sendEmailVariants.ts @@ -247,6 +247,7 @@ export const sendTransactionReceivedEmail = (data: { senderFirstName: string senderLastName: string senderEmail: string + memo: string transactionAmount: Decimal }): Promise | boolean | null> => { return sendEmailTranslated({ @@ -256,6 +257,7 @@ export const sendTransactionReceivedEmail = (data: { firstName: data.firstName, lastName: data.lastName, locale: data.language, + memo: data.memo, senderFirstName: data.senderFirstName, senderLastName: data.senderLastName, senderEmail: data.senderEmail, diff --git a/backend/src/emails/templates/includes/Chatbox.svg b/backend/src/emails/templates/includes/Chatbox.svg new file mode 100644 index 000000000..4eb68e0bb --- /dev/null +++ b/backend/src/emails/templates/includes/Chatbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backend/src/emails/templates/includes/answear_button.svg b/backend/src/emails/templates/includes/answear_button.svg new file mode 100644 index 000000000..f45fedc90 --- /dev/null +++ b/backend/src/emails/templates/includes/answear_button.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + Jetzt antworten + + + diff --git a/backend/src/emails/templates/includes/chatbox-icon.png b/backend/src/emails/templates/includes/chatbox-icon.png new file mode 100644 index 000000000..a25c7c209 Binary files /dev/null and b/backend/src/emails/templates/includes/chatbox-icon.png differ diff --git a/backend/src/emails/templates/includes/chatbox-icon.pug b/backend/src/emails/templates/includes/chatbox-icon.pug new file mode 100644 index 000000000..62775b0f0 --- /dev/null +++ b/backend/src/emails/templates/includes/chatbox-icon.pug @@ -0,0 +1,6 @@ +span.chatbox-wrapper + img.bi-chatbox( + alt="chatbox" + loading="lazy" + src="cid:chatboxicon" + ) \ No newline at end of file diff --git a/backend/src/emails/templates/includes/footer.pug b/backend/src/emails/templates/includes/footer.pug index 5827b203b..91a0e4543 100644 --- a/backend/src/emails/templates/includes/footer.pug +++ b/backend/src/emails/templates/includes/footer.pug @@ -44,9 +44,10 @@ footer class="footer_p2" href='mailto:' + t("emails.footer.supportEmail") )= t("emails.footer.supportEmail") - img.image( - alt="Gradido Logo" - src="https://gdd.gradido.net/img/brand/green.png" + div + img.image( + alt="Gradido Logo" + src="https://gdd.gradido.net/img/brand/green.png" ) div a( diff --git a/backend/src/emails/templates/includes/webflow.css b/backend/src/emails/templates/includes/webflow.css index 02e7fc4e0..a78c0ed4f 100644 --- a/backend/src/emails/templates/includes/webflow.css +++ b/backend/src/emails/templates/includes/webflow.css @@ -51,7 +51,8 @@ h2 { } .button-3, -.button-4 { +.button-4, +.button-5 { display: inline-block; padding: 9px 15px; color: white; @@ -70,6 +71,35 @@ h2 { background-image: radial-gradient(circle farthest-corner at 0% 0%, #616161, #c2c2c2); } +.button-5 { + background: linear-gradient(135deg, #53900c, #6e6e6e); + font-size: 20px; + font-weight: 600; + color: #f5f5f5; + width: auto; + box-shadow: 20px 20px 25px; + transition: all 0.3s ease; +} + +.button-5:hover { + transform: translateY(-5px); + box-shadow: 20px 25px 30px rgba(56, 56, 56, 0.4); +} + +.chatbox-wrapper { + margin-right: 8px; +} +.bi-chatbox { + margin-bottom: -5px; +} + +.child-right { + text-align: right; +} +.child-left { + text-align: left; +} + .socialmedia { display: flex; margin-top: 40px; diff --git a/backend/src/emails/templates/transactionReceived/html.pug b/backend/src/emails/templates/transactionReceived/html.pug index 5370ec03e..4f9aa9c31 100644 --- a/backend/src/emails/templates/transactionReceived/html.pug +++ b/backend/src/emails/templates/transactionReceived/html.pug @@ -1,15 +1,30 @@ extend ../layout.pug -block content +block content + mixin mailto(email, subject) + - var formattedSubject = encodeURIComponent(subject) + a(class!=attributes.class href=`mailto:${email}?subject=${formattedSubject}`) + block + + - var subject= t('emails.transactionReceived.replySubject', { senderFirstName, senderLastName, transactionAmount }) h2= t('emails.transactionReceived.title', { senderFirstName, senderLastName, transactionAmount }) .text-block include ../includes/salutation.pug - p= t('emails.transactionReceived.haveReceivedAmountGDDFrom', { transactionAmount, senderFirstName, senderLastName, senderEmail }) + p + = t('emails.transactionReceived.haveReceivedAmountGDDFrom', { transactionAmount, senderFirstName, senderLastName }) + | ( + +mailto(senderEmail, subject)=senderEmail + |). .content - h2= t('emails.general.transactionDetails') - div(class="p_content")= t('emails.general.detailsYouFindOnLinkToYourAccount') + h2= t('emails.general.message') + .child-left + div(class="p_content")= memo + .child-right + +mailto(senderEmail, subject)(class="button-5") + include ../includes/chatbox-icon.pug + span #{t('emails.general.answerNow')} - a.button-3(href=`${communityURL}/transactions`) #{t('emails.general.toAccount')} + a.button-3(href=`${communityURL}/transactions`) #{t('emails.general.toAccount')} - include ../includes/doNotReply.pug + diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 26e4dcbcd..542fcbb93 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -190,6 +190,7 @@ export const executeTransaction = async ( lastName: recipient.lastName, email: recipient.emailContact.email, language: recipient.language, + memo, senderFirstName: sender.firstName, senderLastName: sender.lastName, senderEmail: sender.emailContact.email, diff --git a/backend/src/graphql/resolver/util/settlePendingSenderTransaction.ts b/backend/src/graphql/resolver/util/settlePendingSenderTransaction.ts index b9c7d8b36..0e293c56c 100644 --- a/backend/src/graphql/resolver/util/settlePendingSenderTransaction.ts +++ b/backend/src/graphql/resolver/util/settlePendingSenderTransaction.ts @@ -119,6 +119,7 @@ export async function settlePendingSenderTransaction( lastName: recipient.lastName, email: recipient.emailContact.email, language: recipient.language, + memo, senderFirstName: sender.firstName, senderLastName: sender.lastName, senderEmail: sender.emailContact.email, diff --git a/backend/src/locales/de.json b/backend/src/locales/de.json index c99e1657e..8c0c8ff0c 100644 --- a/backend/src/locales/de.json +++ b/backend/src/locales/de.json @@ -56,6 +56,7 @@ }, "general": { "amountGDD": "Betrag: {amountGDD} GDD", + "answerNow": "Jetzt antworten", "completeRegistration": "Registrierung abschließen", "contribution": "Gemeinwohl-Beitrag: {contributionMemo}", "contributionDetails": "Beitragsdetails", @@ -63,6 +64,7 @@ "helloName": "Hallo {firstName} {lastName},", "linkValidity": "Der Link hat eine Gültigkeit von {hours} Stunden.\nSollte die Gültigkeit des Links bereits abgelaufen sein, kannst du dir hier einen neuen Link schicken lassen.", "linkValidityWithMinutes": "Der Link hat eine Gültigkeit von {hours} Stunden und {minutes} Minuten.\nSollte die Gültigkeit des Links bereits abgelaufen sein, kannst du dir hier einen neuen Link schicken lassen.", + "message": "Nachricht", "newLink": "Neuer Link", "orCopyLink": "Oder kopiere den Link in dein Browserfenster.", "pleaseDoNotReply": "Bitte antworte nicht auf diese E-Mail.", @@ -86,8 +88,9 @@ "title": "{senderFirstName} {senderLastName} hat deinen Gradido-Link eingelöst" }, "transactionReceived": { - "haveReceivedAmountGDDFrom": "du hast soeben {transactionAmount} GDD von {senderFirstName} {senderLastName} ({senderEmail}) erhalten.", + "haveReceivedAmountGDDFrom": "du hast soeben {transactionAmount} GDD erhalten von {senderFirstName} {senderLastName}", "subject": "{senderFirstName} {senderLastName} hat dir {transactionAmount} Gradido gesendet", + "replySubject": "Re: {senderFirstName} {senderLastName} hat dir {transactionAmount} Gradido gesendet", "title": "{senderFirstName} {senderLastName} hat dir {transactionAmount} Gradido gesendet" } }, diff --git a/backend/src/locales/en.json b/backend/src/locales/en.json index 15a56577c..9b6b2a4cf 100644 --- a/backend/src/locales/en.json +++ b/backend/src/locales/en.json @@ -56,6 +56,7 @@ }, "general": { "amountGDD": "Amount: {amountGDD} GDD", + "answerNow": "Reply", "completeRegistration": "Complete registration", "contribution": "Contribution: : {contributionMemo}", "contributionDetails": "Contribution details", @@ -63,6 +64,7 @@ "helloName": "Hello {firstName} {lastName},", "linkValidity": "The link has a validity of {hours} hours.\nIf the validity of the link has already expired, you can have a new link sent to you here.", "linkValidityWithMinutes": "The link has a validity of {hours} hours and {minutes} minutes.\nIf the validity of the link has already expired, you can have a new link sent to you here.", + "message": "Message", "newLink": "New link", "orCopyLink": "Or copy the link into your browser window.", "pleaseDoNotReply": "Please do not reply to this email.", @@ -86,7 +88,8 @@ "title": "{senderFirstName} {senderLastName} has redeemed your Gradido link" }, "transactionReceived": { - "haveReceivedAmountGDDFrom": "You have just received {transactionAmount} GDD from {senderFirstName} {senderLastName} ({senderEmail}).", + "haveReceivedAmountGDDFrom": "You have just received {transactionAmount} GDD from {senderFirstName} {senderLastName}", + "replySubject": "RE: {senderFirstName} {senderLastName} has sent you {transactionAmount} Gradido", "subject": "{senderFirstName} {senderLastName} has sent you {transactionAmount} Gradido", "title": "{senderFirstName} {senderLastName} has sent you {transactionAmount} Gradido" }