Skip to content

Commit eb15084

Browse files
committed
display data beauty b12
1 parent a4b9a16 commit eb15084

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

pages/api/add/campaign.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -348,25 +348,29 @@ const generateContent = async (
348348
const userPrompt = `
349349
**Generate an email to ${firstName} using the provided template in a ${tone} tone.**
350350
**Personalize the email** to increase the likelihood of a positive response by:
351+
351352
** Highlighting how our partnership can help them achieve their goals.
353+
352354
** Personalize by mentioning commonalities between the sender and receipient share (company, roles, titles, etc.). Extract the commonalities from the following:
353355
### start of common attributes
354356
${commonAttributes}
355357
### end of common attributes.
356-
** Personalize the message based their receiver's company's product / services which is as follows:
358+
359+
** Personalize by mentioning about their recent news which is as follows:
360+
### start of recent news
361+
${organic_results}
362+
### end of recent news
363+
364+
** Personalize the message based their receiver's company's product / services which is as follows:
357365
### start of summary
358366
${websiteSummary}
359367
### end of summary.
360-
** Personalize the message based their sender's product / services which is as follows:
361-
### start of summary
362-
${productSummary}
363-
### end of summary.
368+
369+
** Personalize the message based their sender's product or services which is as follows
370+
### start of summary
371+
${productSummary}
372+
### end of summary.
364373
365-
** Personalize by referencing recent news from web data which is as follows:
366-
### start of web data news
367-
${organic_results}
368-
### end of web data news
369-
370374
** Target word count:** ${minWords} - ${maxWords}.
371375
372376
**Sender:** ${creatorFirstName} <span class="math-inline">\{creatorLastName\} \(<</span>{creatorEmail}>).
@@ -381,8 +385,8 @@ const generateContent = async (
381385

382386
let result = await generateEmailContent(key, templateContent, userPrompt);
383387
result = result
384-
.replace('{{fixed_text_start}}', '')
385-
.replace('{{fixed_text_end}}', '');
388+
.replaceAll('{{fixed_text_start}}', '')
389+
.replaceAll('{{fixed_text_end}}', '');
386390
return [result, commonAttributes];
387391
};
388392

pages/campaign/campaign-details.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ const CampaignDetails = ({ campaign_id: campaign_id }) => {
112112
const downloadEmailEventsCSV = () => {
113113
const csvRows = [
114114
// Define CSV headers
115-
`"ID","Email","Company","Event Content"`
115+
`"ID","Email","Name","LinkedIn","Company","Event Content"`
116116
];
117117

118118
// Iterate over email events and convert each to a CSV row
119119
emailEvents.forEach((event) => {
120120
const csvRow = [
121121
`"${event.id}"`,
122122
`"${event.contact.email}"`,
123+
`"${event.contact.firstName} ${event.contact.lastName}"`,
124+
`"${event.contact.linkedIn}"`,
123125
`"${event.contact.company}"`,
124126
`"${event.eventContent.replace(/"/g, '""')}"` // Escape double quotes
125127
].join(',');

0 commit comments

Comments
 (0)