@@ -303,6 +367,9 @@
.auth-container {
max-inline-size: 27.5rem;
}
+ .review-container {
+ max-inline-size: 30rem;
+ }
.logo-variation {
padding-block-start: 2rem;
@@ -313,4 +380,11 @@
}
}
}
+
+ .review-footer-container {
+ padding-block-start: 10rem;
+ @media #{$break1} {
+ padding-block-start: 5rem;
+ }
+ }
diff --git a/src/lib/stores/campaigns.ts b/src/lib/stores/campaigns.ts
index cf381f16d..6ffc9e0f1 100644
--- a/src/lib/stores/campaigns.ts
+++ b/src/lib/stores/campaigns.ts
@@ -1,40 +1,119 @@
//campaign welcome and startup
-type CampaignData = {
+export type CampaignData = {
title: string;
description: string;
+ template: 'card' | 'review';
+ data?: Record;
+ onlyNewOrgs?: boolean;
+ footer?: boolean;
};
export const campaigns: Map = new Map();
campaigns
.set('welcome', {
+ template: 'card',
title: "You've received $VALUE in credits",
description:
'Get $VALUE in credits when you upgrade or create an organization with a Pro plan.'
})
.set('startup', {
+ template: 'card',
title: 'Welcome to the Startups program!',
description:
"We're excited to have you on board. Add the coupon code to your Appwrite Pro account to join."
})
.set('RenderATL2024', {
+ template: 'card',
title: 'Claim your $100 RenderATL credits',
description:
'Get $100 in Cloud credits when you upgrade or create an organization with a Pro plan.'
})
.set('dealsfordevs', {
+ template: 'card',
title: 'Claim your $50 Deals For Devs credits',
description:
'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan.'
})
.set('WelcomeManual', {
+ template: 'card',
title: 'Here is your $VALUE welcome credit!',
description:
'Upgrade to Appwrite Pro and add the credits to enjoy the full capabilities of Cloud.'
})
.set('InactiveAccounts', {
+ template: 'card',
title: 'Get everything out of Cloud. Claim your $VALUE credits.',
description:
'Get $VALUE in Cloud credits when you upgrade or create an organization with a Pro plan.'
+ })
+ .set('StartupsProgram', {
+ template: 'review',
+ title: 'Welcome to the Startups program',
+ description:
+ "We're excited to have you on board. Add your credit code to your Appwrite Pro account to join.",
+ onlyNewOrgs: true,
+ data: {
+ cta: 'Get everything out of Cloud with Pro',
+ claimed: 'Your credits will be valid for 12 months.',
+ unclaimed: 'Apply your code to join the Startups program.',
+ reviews: [
+ {
+ name: 'David Foster',
+ img: '1.jpeg',
+ desc: 'Managing director',
+ review: 'We really loved working with Appwrite for launching our bootstrapped "Open Mind" App. It was saving us a lot of money in comparison to Firebase since the amount of users grew quite fast and we needed a quick switch.'
+ }
+ ]
+ }
+ })
+ .set('JSMastery', {
+ template: 'review',
+ title: 'Claim your JavaScript Mastery $50 credits.',
+ description:
+ 'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan',
+ data: {
+ reviews: [
+ {
+ name: 'Marius Bloki',
+ desc: 'CTO // mySHOEFITTER',
+ img: 'js_mastery_reviewer_1.png',
+ review: 'Appwrite has been a tremendous asset in implementing our IT infrastructure. Not only is the software an absolute game-changer, but the team is always there when you need them.'
+ }
+ ]
+ }
+ })
+ .set('FusionVC', {
+ template: 'review',
+ title: 'Welcome to Appwrite!',
+ description:
+ 'Upgrade to Appwrite Pro and add the credits to enjoy the full capabilities of Cloud. Provided to you by Fusion VC.',
+ footer: true,
+ data: {
+ reviews: [
+ {
+ name: 'David Foster',
+ img: '1.jpeg',
+ desc: 'Managing director',
+ review: 'We really loved working with Appwrite for launching our bootstrapped "Open Mind" App. It was saving us a lot of money in comparison to Firebase since the amount of users grew quite fast and we needed a quick switch.'
+ }
+ ]
+ }
+ })
+ .set('carbon', {
+ template: 'review',
+ title: 'Build your entire backend within minutes.',
+ description:
+ 'Get $50 in Cloud credits when you upgrade or create an organization with a Pro plan.',
+ data: {
+ reviews: [
+ {
+ name: 'David Foster',
+ img: '1.jpeg',
+ desc: 'Managing director',
+ review: 'We really loved working with Appwrite for launching our bootstrapped "Open Mind" App. It was saving us a lot of money in comparison to Firebase since the amount of users grew quite fast and we needed a quick switch.'
+ }
+ ]
+ }
});
diff --git a/src/routes/console/apply-credit/+page.svelte b/src/routes/console/apply-credit/+page.svelte
index 4395538f1..d1dd1ce47 100644
--- a/src/routes/console/apply-credit/+page.svelte
+++ b/src/routes/console/apply-credit/+page.svelte
@@ -67,10 +67,11 @@
let name: string;
let coupon: string;
let couponData = data?.couponData;
+ let campaign = campaigns.get(data?.couponData?.campaign ?? data?.campaign);
onMount(async () => {
await loadPaymentMethods();
- if (!$organizationList?.total) {
+ if (!$organizationList?.total || campaign?.onlyNewOrgs) {
selectedOrgId = newOrgId;
}
});
@@ -183,7 +184,6 @@
$: isButtonDisabled =
checkButtonDisabled(selectedOrgId, name, paymentMethodId) ||
couponData?.status !== 'active';
- $: campaign = campaigns.get(data?.couponData?.campaign ?? data?.campaign);
function checkButtonDisabled(id: string | null, name: string | null, method: string | null) {
if (id === newOrgId) {
@@ -207,7 +207,7 @@
-