Skip to content

Commit

Permalink
fix links in formatEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed Jul 30, 2024
1 parent 7e8e7e9 commit e9063a9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
18 changes: 9 additions & 9 deletions action-network-message-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const draftANMessage = (doc, apiKey) => {
return;
}

const subject = `🌹 ${emailSubject} for ${Utilities.formatDate(new Date(), "UTC", "yyyy-MM-dd")} 🌹`;
const subject = `🌹 ${emailSubject} for ${Utilities.formatDate(new Date(), "UTC", "yyyy-MM-dd")} 🫎`;

const payload = {
subject,
Expand All @@ -34,22 +34,22 @@ const draftANMessage = (doc, apiKey) => {

payload.targets = emailTarget
? [
{
href: `${apiUrlAn}queries/${emailTarget}`,
},
]
{
href: `${apiUrlAn}queries/${emailTarget}`,
},
]
: undefined;

payload._links["osdi:wrapper"] = emailWrapper
? {
href: `${apiUrlAn}wrappers/${emailWrapper}`,
}
href: `${apiUrlAn}wrappers/${emailWrapper}`,
}
: undefined;

payload._links["osdi:creator"] = emailCreator
? {
href: `${apiUrlAn}people/${emailCreator}`,
}
href: `${apiUrlAn}people/${emailCreator}`,
}
: undefined;

const options = {
Expand Down
2 changes: 1 addition & 1 deletion slack-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const sendSlackMessage = (title, message, url, image) => {
const options = {
method: "POST",
contentType: "application/json",
payload: JSON.stringify(slack_webhook_message),
payload: JSON.stringify(slack_webhook_message)
};

UrlFetchApp.fetch(scriptProperties.getProperty("SLACK_WEBHOOK_URL"), options);
Expand Down
7 changes: 5 additions & 2 deletions text.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const calDescription = (event) => {

// This function takes a location object as an argument and generates a string with the venue, address, locality, region, and postal code
const formatLocation = (location) => {
const {venue, address_lines, locality, region, postal_code} = location;
const { venue, address_lines, locality, region, postal_code } = location;
return `${venue}, ${address_lines.join()}, ${locality}, ${region} ${postal_code}`;
};

Expand Down Expand Up @@ -60,7 +60,10 @@ const formatEvent = (event) => {
: "";
const button_rsvp = `<a href="${encodeURI(event.browser_url)}" target="_blank"><button type="button">Sign Me Up</button></a>`;

return `<article class="event_article">${template_title}${template_time_and_link}${image_url}${button_rsvp}${event.description}</article>`;
const formatted_body = `<article class="event_article">${template_title}${template_time_and_link}${image_url}${button_rsvp}${event.description}</article>`;

return formatted_body
.replace(/<a /g, `<a `)
};

const getUpcomingEventLimitFilter = (nextdays) => {
Expand Down

0 comments on commit e9063a9

Please sign in to comment.