Skip to content

Commit

Permalink
Merge branch 'main' into multi-api
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos authored Mar 25, 2024
2 parents a74f51c + c9609f6 commit 06f9112
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,37 @@
[![DevSkim](https://github.com/MaineDSA/ActionNetworkEventSync/actions/workflows/devskim.yml/badge.svg)](https://github.com/MaineDSA/ActionNetworkEventSync/actions/workflows/devskim.yml)

# ActionNetworkScript

Automation for Action Network, Google Calendar, and Slack

## Features

This Google Apps Script code simplifies some more labor-intensive Action Network tasks:

- **syncANtoGCal()** Retrieving a list of recently-edited Action Network events and syncing them to Google Calendar.
- **draftANEventMessage()** Retriving a list of upcoming Action Network events and compiling them into an HTML-formatted email to be sent to a single address.
- **emailFormattedEventList()** Retriving a list of upcoming Action Network events and compiling them into an HTML-formatted Gmail email.
- **postTodaysEvents()** Retriving a list of upcoming Action Network events and compiling them into a regular Slack post.
- **draftANEventMessage()** Retriving a list of upcoming Action Network events and compiling them into an HTML-formatted
email to be sent to a single address.
- **emailFormattedEventList()** Retriving a list of upcoming Action Network events and compiling them into an
HTML-formatted Gmail email.
- **postTodaysEvents()** Retriving a list of upcoming Action Network events and compiling them into a regular Slack
post.

## Screenshots

### Generated Email

<a href="https://github.com/MaineDSA/ActionNetworkEventSync/assets/1916835/7a017df7-5a18-408e-aa7d-d85ec40fcfc1"><img src="https://github.com/MaineDSA/ActionNetworkEventSync/assets/1916835/7a017df7-5a18-408e-aa7d-d85ec40fcfc1" alt="Example of Generated Action Network Draft" align="left" height="520"></a>

### New Event Notification in Slack

<a href="https://github.com/MaineDSA/ActionNetworkEventSync/assets/1916835/a211d773-0be6-4421-a6b4-d63bfb7b2bf9"><img src="https://github.com/MaineDSA/ActionNetworkEventSync/assets/1916835/a211d773-0be6-4421-a6b4-d63bfb7b2bf9" alt="Slack Message announcing new event" height="480"></a>

## Script Properties
To use these features, you must configure [Script Properties](https://developers.google.com/apps-script/reference/properties) in your Google Apps script.

To use these features, you must
configure [Script Properties](https://developers.google.com/apps-script/reference/properties) in your Google Apps
script.

- AN_API_KEY: Your Action Network API Key (or a comma-separated list if you have multiple groups).
- AN_EMAIL_REPLY_TO: The email you want generated AN email drafts to use as the reply-to address.
- AN_EMAIL_SENDER: The name you want displayed as the sender for generated AN email.
Expand All @@ -32,16 +45,22 @@ To use these features, you must configure [Script Properties](https://developers
- LINK_COLOR: Preferred color for HTML links in HTML-formatted email bodies as a hex code. We use ec1f27.
- TIME_DST: The time zone you use during Daylight Savings Time. We use GMT-04:00.
- TIME_STANDARD: The time zone you use outside of Daylight Savings Time. We use GMT-05:00
- SLACK_WEBHOOK_URL: (OPTIONAL) A Slack webhook URL to notify when creating or canceling upcoming Google Calendar events and for the daily upcoming events digest.
- SLACK_WEBHOOK_URL: (OPTIONAL) A Slack webhook URL to notify when creating or canceling upcoming Google Calendar events
and for the daily upcoming events digest.

# Additional Customization

As some desired customization cannot be attained through properties, some tie-in points are provided.
Creating the following functions in a new script file will allow you to insert additional text at key places.
If not configured, these will be skipped.
- formattedDescriptionFooter(formatted_event_description): Creating this function allows you to add an HTML-formatted string to the end of each event, as posted to Google Calendar.
- formattedCalendarText(events): Creating this function allows you to add additional information to the "Upcoming Events" section, between the header and list of events.

- formattedDescriptionFooter(formatted_event_description): Creating this function allows you to add an HTML-formatted
string to the end of each event, as posted to Google Calendar.
- formattedCalendarText(events): Creating this function allows you to add additional information to the "Upcoming
Events" section, between the header and list of events.

## Triggering

- Our script is set to call syncANtoGCal() every 10 minutes.
- Our script is set to call draftANEventMessage() every Tuesday morning.
- Our script is set to call postTodaysEvents() every morning.
1 change: 0 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,4 @@ const postTodaysEvents = () => {

const doc = eventAnnouncements.join(' ');
sendSlackMessage(doc);

};

0 comments on commit 06f9112

Please sign in to comment.