Skip to content

Commit f3060cd

Browse files
authored
feat: email template for subscription price changes due to tax (#4386)
* feat: subscription tax change email * feat: wording * feat: subscription id var for support & finalize tax change email script
1 parent 1a1b9f5 commit f3060cd

File tree

5 files changed

+62
-2
lines changed

5 files changed

+62
-2
lines changed

apps/frontend/src/emails/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default {
1616
'payout-available': () => import('./templates/account/PayoutAvailable.vue'),
1717
'personal-access-token-created': () => import('./templates/account/PATCreated.vue'),
1818

19+
// Subscriptions
20+
'subscription-tax-change': () => import('./templates/account/SubscriptionTaxChange.vue'),
21+
1922
// Moderation
2023
'report-submitted': () => import('./templates/moderation/ReportSubmitted.vue'),
2124
'report-status-updated': () => import('./templates/moderation/ReportStatusUpdated.vue'),

apps/frontend/src/emails/shared/StyledEmail.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
defineProps<{
1818
title?: string
1919
manualLinks?: { link: string; label?: string }[]
20+
supportInfo?: string[]
2021
}>()
2122
2223
interface SocialLink {
@@ -211,9 +212,19 @@ const socialLinks = Object.freeze<readonly SocialLink[]>([
211212

212213
<hr />
213214

215+
<Section v-if="supportInfo && supportInfo.length" class="mb-0 pb-0 pl-4 pr-4 pt-0">
216+
<Text
217+
v-for="(line, index) in supportInfo"
218+
:key="index"
219+
class="text-footerText text-2xs font-sans"
220+
>
221+
{{ line }}
222+
</Text>
223+
</Section>
224+
214225
<Section
215226
v-if="manualLinks && manualLinks.length"
216-
class="text-footerText text-2xs mb-4 mt-4 pb-0 pl-4 pr-4 pt-0 font-sans"
227+
class="text-footerText text-2xs mb-4 pb-0 pl-4 pr-4 pt-0 font-sans"
217228
>
218229
<small class="text-muted text-2xs"
219230
>If you're having trouble with the links above, copy and paste these URLs into your

apps/frontend/src/emails/templates/account/PaymentFailed.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import StyledEmail from '@/emails/shared/StyledEmail.vue'
88
<StyledEmail
99
title="Payment failed for {paymentfailed.service}"
1010
:manual-links="[{ link: '{billing.url}', label: 'Billing settings' }]"
11+
:support-info="['{subscription.id}']"
1112
>
1213
<Heading as="h1" class="mb-2 text-2xl font-bold">
1314
Payment failed for {paymentfailed.service}

apps/frontend/src/emails/templates/account/PayoutAvailable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import StyledEmail from '@/emails/shared/StyledEmail.vue'
1717
<Text class="text-base">Hi {user.name},</Text>
1818

1919
<Text class="text-base">
20-
The ${payout.amount} earned during {payout.period} has been processed and is now available to
20+
The {payout.amount} earned during {payout.period} has been processed and is now available to
2121
withdraw from your account.
2222
</Text>
2323

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script setup lang="ts">
2+
import { Heading, Link as VLink, Text } from '@vue-email/components'
3+
4+
import StyledEmail from '@/emails/shared/StyledEmail.vue'
5+
</script>
6+
7+
<template>
8+
<StyledEmail
9+
title="Price change for {taxnotification.service}"
10+
:manual-links="[{ link: 'https://support.modrinth.com', label: 'Support Portal' }]"
11+
:support-info="['{subscription.id}']"
12+
>
13+
<Heading as="h1" class="mb-2 text-2xl font-bold">
14+
Price change for {taxnotification.service}
15+
</Heading>
16+
17+
<Text class="text-muted text-base">Hi {user.name},</Text>
18+
<Text class="text-muted text-base">
19+
We're writing to let you know about an update to your {taxnotification.service} subscription.
20+
</Text>
21+
22+
<Text class="text-muted text-base">
23+
Your plan and rate are staying the same. The only change is that your region is now subject to
24+
tax. Starting {taxnotification.due}, your next charge will include
25+
{taxnotification.new_tax_amount} in tax.
26+
</Text>
27+
28+
<Text class="text-muted text-base">
29+
You do not need to take any action. This change will apply automatically on
30+
{taxnotification.due}.
31+
</Text>
32+
33+
<Text class="text-muted text-base">
34+
Thank you for choosing Modrinth! If you have any questions or need help with your
35+
subscription, reply to this email or visit our
36+
<VLink href="https://support.modrinth.com" class="text-green underline">Support Portal</VLink
37+
>.
38+
</Text>
39+
40+
<Text class="text-muted text-base">
41+
Best,<br />
42+
The Modrinth Team
43+
</Text>
44+
</StyledEmail>
45+
</template>

0 commit comments

Comments
 (0)