Skip to content

Commit 59248c8

Browse files
author
Lauren Pothuru
committed
Style newsletter components
1 parent c9b692d commit 59248c8

6 files changed

Lines changed: 80 additions & 61 deletions

File tree

backend/scripts/email/components/NeighborhoodComparison.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const NeighborhoodComparison: React.FC<Props> = ({
6767
width: '100%',
6868
height: 'auto',
6969
overflow: 'hidden',
70-
marginRight: '20px',
70+
marginBottom: '5px',
7171
}}
7272
/>
7373
<p
@@ -97,7 +97,13 @@ const NeighborhoodComparison: React.FC<Props> = ({
9797
<img
9898
src={image2}
9999
alt=""
100-
style={{ borderRadius: '8px', width: '100%', height: 'auto', overflow: 'hidden' }}
100+
style={{
101+
borderRadius: '8px',
102+
width: '100%',
103+
height: 'auto',
104+
overflow: 'hidden',
105+
marginBottom: '5px',
106+
}}
101107
/>
102108
<p
103109
style={{

backend/scripts/email/components/PropertyCard.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const PropertyCard = ({ property }: { property: ApartmentWithId }): React.ReactE
2222
'https://images.squarespace-cdn.com/content/v1/665f8368e87e4548121b2b1b/1739995859299-Q3ZMFXYTF9PB4FXHRKE1/Carey-Building-Apartments_ALT.jpg'
2323
}
2424
alt={property.name || 'Property'}
25-
style={{ borderRadius: '8px', width: '152px', height: '122px', overflow: 'hidden' }}
25+
style={{ borderRadius: '8px', width: '150px', height: '122px', overflow: 'hidden' }}
2626
/>
2727
<h2
2828
style={{
@@ -42,21 +42,25 @@ const PropertyCard = ({ property }: { property: ApartmentWithId }): React.ReactE
4242
{property.address}
4343
</p>
4444
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
45-
<div style={{ display: 'flex', alignItems: 'center' }}>
45+
<div
46+
style={{ display: 'flex', alignItems: 'center', textAlign: 'center', marginRight: '10px' }}
47+
>
4648
<img
4749
src="https://static-00.iconduck.com/assets.00/money-icon-1024x1024-f6dh1k6o.png"
4850
alt="$"
4951
style={{ width: '13px', height: '13px', marginRight: '4px' }}
5052
/>
51-
<p style={{ fontWeight: '600', fontSize: '12px', margin: '0' }}>price</p>
53+
<p style={{ fontWeight: '600', fontSize: '12px', margin: '0', color: '#000' }}>price</p>
5254
</div>
53-
<div style={{ display: 'flex', alignItems: 'center' }}>
55+
<div style={{ display: 'flex', alignItems: 'center', textAlign: 'center' }}>
5456
<img
5557
src="https://cdn-icons-png.flaticon.com/512/952/952772.png"
5658
alt="bed"
5759
style={{ width: '16px', height: '16px', marginRight: '4px' }}
5860
/>
59-
<p style={{ fontWeight: '600', fontSize: '12px', margin: '0' }}>{property.numBeds} Bed</p>
61+
<p style={{ fontWeight: '600', fontSize: '12px', margin: '0', color: '#000' }}>
62+
{property.numBeds} Bed
63+
</p>
6064
</div>
6165
</div>
6266
</>

backend/scripts/email/components/ReelsFeature.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,20 @@ const ReelsFeature: React.FC<Props> = ({ gifUrl, description }: Props) => (
5151
<p style={{ color: '#5D5D5D', fontSize: '14.976px', marginBottom: '15px' }}>
5252
{description}
5353
</p>
54-
<div style={{ backgroundColor: '#B94630', padding: '10px 12px', borderRadius: '8px' }}>
54+
<div
55+
style={{
56+
backgroundColor: '#B94630',
57+
padding: '10px 12px',
58+
borderRadius: '8px',
59+
color: '#5D5D5D',
60+
width: 'fit-content',
61+
}}
62+
>
5563
<a
5664
href="https://www.instagram.com/cuapts/"
5765
style={{
5866
textDecoration: 'none',
67+
color: '#FFF6F6',
5968
}}
6069
>
6170
View More

backend/scripts/email/emailService.ts

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -108,36 +108,36 @@ const sendEmailCampaign = async (options: EmailCampaignOptions = {}): Promise<vo
108108

109109
const resend = new Resend(apiKey);
110110

111-
// const userBatches = await getUserBatches(50);
111+
// const userBatches = await getUserBatches(50);
112+
// console.log(
113+
// `Preparing to send emails to ${userBatches.length} batches of users (${50} per batch)`
114+
// );
115+
116+
// const emailPromises = userBatches.map(async (batch, i) => {
117+
// const bccEmails = batch.map((user) => user.email);
112118
// console.log(
113-
// `Preparing to send emails to ${userBatches.length} batches of users (${50} per batch)`
119+
// `Preparing batch ${i + 1}/${userBatches.length} with ${bccEmails.length} recipients`
114120
// );
115121

116-
// const emailPromises = userBatches.map(async (batch, i) => {
117-
// const bccEmails = batch.map((user) => user.email);
118-
// console.log(
119-
// `Preparing batch ${i + 1}/${userBatches.length} with ${bccEmails.length} recipients`
120-
// );
121-
122-
// const { data, error } = await resend.emails.send({
123-
// from: `${fromName} <${fromEmail}>`,
124-
// to: toEmail,
125-
// // bcc: bccEmails,
126-
// subject,
127-
// react: React.createElement(GenerateNewsletter, {
128-
// recentLandlordProperties,
129-
// lovedProperties,
130-
// recentAreaProperties,
131-
// }),
132-
// });
133-
134-
// if (error) {
135-
// console.error(`Error sending batch ${i + 1}:`, error);
136-
// } else {
137-
// console.log(`Batch ${i + 1} sent successfully! ID:`, data?.id || 'no ID returned');
138-
// }
122+
// const { data, error } = await resend.emails.send({
123+
// from: `${fromName} <${fromEmail}>`,
124+
// to: toEmail,
125+
// // bcc: bccEmails,
126+
// subject,
127+
// react: React.createElement(GenerateNewsletter, {
128+
// recentLandlordProperties,
129+
// lovedProperties,
130+
// recentAreaProperties,
131+
// }),
139132
// });
140133

134+
// if (error) {
135+
// console.error(`Error sending batch ${i + 1}:`, error);
136+
// } else {
137+
// console.log(`Batch ${i + 1} sent successfully! ID:`, data?.id || 'no ID returned');
138+
// }
139+
// });
140+
141141
// await Promise.all(emailPromises);
142142
// console.log('All email batches sent successfully!');
143143
// } catch (err) {
@@ -149,26 +149,26 @@ const sendEmailCampaign = async (options: EmailCampaignOptions = {}): Promise<vo
149149
* To use, uncomment code below, comment out lines 82-86 and 108-143, edit info below,
150150
* and run the file as normal.
151151
*/
152-
// try {
153-
// // In your main file
154-
// const { data, error } = await resend.emails.send({
155-
// from: 'updates@cuapts.org',
156-
// to: 'laurenpothuru@gmail.com',
157-
// subject: subject,
158-
// react: React.createElement(GenerateNewsletter, {
159-
// recentLandlordProperties,
160-
// lovedProperties,
161-
// recentAreaProperties,
162-
// }),
163-
// });
164-
// if (error) {
165-
// console.error('Error sending email:', error);
166-
// } else {
167-
// console.log('Email sent successfully! ID:', data ? data.id : ' no ID returned.');
168-
// }
169-
// } catch (err) {
170-
// console.error('Exception when sending email:', err);
171-
// }
152+
try {
153+
// In your main file
154+
const { data, error } = await resend.emails.send({
155+
from: 'updates@cuapts.org',
156+
to: 'lsp75@cornell.edu',
157+
subject,
158+
react: React.createElement(GenerateNewsletter, {
159+
recentLandlordProperties,
160+
lovedProperties,
161+
recentAreaProperties,
162+
}),
163+
});
164+
if (error) {
165+
console.error('Error sending email:', error);
166+
} else {
167+
console.log('Email sent successfully! ID:', data ? data.id : ' no ID returned.');
168+
}
169+
} catch (err) {
170+
console.error('Exception when sending email:', err);
171+
}
172172
};
173173

174174
/**

backend/scripts/email/templates/GenerateNewsletter.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ const GenerateNewsletter: React.FC<GenerateNewsletterProps> = ({
102102
const advice: AdviceProps = {
103103
name: 'A Cornell Student',
104104
message: 'You should do this and this and this in the housing search process. good luck!',
105+
major: 'Real Estate',
106+
year: '2024',
107+
apartment: 'Collegetown Crossings',
105108
};
106109

107110
/**
@@ -169,8 +172,7 @@ const GenerateNewsletter: React.FC<GenerateNewsletterProps> = ({
169172
* @property {string} description - Detailed description of the feature and its benefits
170173
*/
171174
const featureSpotlight: FeatureSpotlightProps = {
172-
imgUrl:
173-
'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTOJgeX2Q_YP7mHSFPphSHfTILVHFWBdmaYgEHJfPsTADW2nlMm',
175+
imgUrl: 'https://i.postimg.cc/855xZ26H/cuapts.png',
174176
featureName: 'Feature Name',
175177
description:
176178
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec porttitor ligula. Duis eget augue rhoncus, dapibus orci ut, vestibulum nisi. Suspendisse hendrerit viverra odio a gravida.',
@@ -193,7 +195,7 @@ const GenerateNewsletter: React.FC<GenerateNewsletterProps> = ({
193195
description:
194196
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec porttitor ligula. Duis eget augue rhoncus, ',
195197
phoneNumber: '1234567890',
196-
email: 'dummyemail@gmail.com',
198+
email: 'exampleemail@gmail.com',
197199
};
198200

199201
/**
@@ -216,10 +218,8 @@ const GenerateNewsletter: React.FC<GenerateNewsletterProps> = ({
216218
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec porttitor ligula. \n-Duis eget augue rhoncus\n-dapibus orci ut, vestibulu\n-Lorem ipsum dolor sit amet,\n-consectetur adipiscing elit.\n-Pellentesque nec porttitor ligula Duis eget',
217219
description2:
218220
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec porttitor ligula. \n-Duis eget augue rhoncus\n-dapibus orci ut, vestibulu\n-Lorem ipsum dolor sit amet,\n-consectetur adipiscing elit.\n-Pellentesque nec porttitor ligula Duis eget',
219-
image1:
220-
'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTOJgeX2Q_YP7mHSFPphSHfTILVHFWBdmaYgEHJfPsTADW2nlMm',
221-
image2:
222-
'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTOJgeX2Q_YP7mHSFPphSHfTILVHFWBdmaYgEHJfPsTADW2nlMm',
221+
image1: 'https://i.postimg.cc/jdVkfwZv/Frame-2263.png',
222+
image2: 'https://i.postimg.cc/jdVkfwZv/Frame-2263.png',
223223
};
224224

225225
return (

backend/scripts/email/templates/Newsletter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const Newsletter: React.FC<NewsletterProps> = ({
118118
fontWeight: '400',
119119
}}
120120
>
121-
<strong style={{ fontWeight: '700' }}>Hi {firstName}!</strong> {introductionMessage}
121+
<strong style={{ fontWeight: '700' }}>Hi!</strong> {introductionMessage}
122122
</Text>
123123

124124
{/* landlord section */}

0 commit comments

Comments
 (0)