{"id":18356657,"url":"https://github.com/b-lawlor/renewal-notifications","last_synced_at":"2025-04-10T01:49:19.633Z","repository":{"id":205847182,"uuid":"233670883","full_name":"b-lawlor/Renewal-Notifications","owner":"b-lawlor","description":"Google Apps Script project that uses Sierra API to send patrons notification e-mails","archived":false,"fork":false,"pushed_at":"2020-01-13T21:20:46.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T17:46:32.699Z","etag":null,"topics":["apps-script","google-apps-script","sierra-api"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b-lawlor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-01-13T19:02:24.000Z","updated_at":"2020-01-27T13:17:41.000Z","dependencies_parsed_at":"2023-11-07T02:03:04.393Z","dependency_job_id":"beff3291-5fbb-4b3c-b11e-70cf0ebcdfbd","html_url":"https://github.com/b-lawlor/Renewal-Notifications","commit_stats":null,"previous_names":["b-lawlor/renewal-notifications"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-lawlor%2FRenewal-Notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-lawlor%2FRenewal-Notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-lawlor%2FRenewal-Notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-lawlor%2FRenewal-Notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-lawlor","download_url":"https://codeload.github.com/b-lawlor/Renewal-Notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142741,"owners_count":21054667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apps-script","google-apps-script","sierra-api"],"created_at":"2024-11-05T22:11:04.291Z","updated_at":"2025-04-10T01:49:19.611Z","avatar_url":"https://github.com/b-lawlor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Google Apps Script project that uses Sierra API to send patrons notification e-mails. Created by Brendan Lawlor for test purposes only. Use at your own risk. Not supported by CLAMS.\n\n# Quickstart\n\n## Install Node.js\nhttps://nodejs.org/en/download/\n\n## Install clasp\n```\nnpm install @google/clasp -g\n```\n\n## Enable the Google Apps Script API\nhttps://script.google.com/home/usersettings\n\n## Clone this Repo\n```\ngit clone https://github.com/b-lawlor/Renewal-Notifications\n```\n\n## Create a New Apps Script Project\n```\ncd Renewal-Notifications\nclasp login\nclasp create --title \"Renewal Notifications\"\n```\n**choose standalone**\n```\nclasp push\nclasp open\n```\n\n## Edit Apps Script Code\n\nIn auth.gs:\n```\ngetToken_()\n    var key = \"YOUR SIERRA API KEY\";\n    var secret = \"YOUR SUPER SECRET API SECRET\";\n    var getTokenUrl = \"https://LIBRARY.DOMAIN/iii/sierra-api/v5/token\";\n```\n\nIn main.gs:\n```\nmain()\n    // set limit field to a low number for testing\n    var url = \"https://LIBRARY.DOMAIN/iii/sierra-api/v5/patrons/query?offset=0\u0026limit=3\";\n\nsendNotifications()\n    var supportEmail = \"support@LIBRAY.DOMAIN\"\n    var testEmail = \"you@LIBRARY.DOMAIN\"\n    // uncomment to send emails to patrons\n    //GmailApp.sendEmail(patron.emails[0], subject, body, options);\n\ngetLocations()\n    var loc = apiGet(token, \"https://LIBRARY.DOMAIN/iii/sierra-api/v5/branches/pickupLocations\");\n```\n\nIn emailBody.gs:\n```\ngetPlainBody()\n    var body = \"notification plain text\"\ngetHtmlBody()\n    var body = \"notification with html markup\"\n```\n\n## Authorize the Script\n1. Run-\u003e Run function -\u003e main\n2. Click Allow\n\n\n## Add a Trigger\n\n1. Edit-\u003e Current project's triggers\n2. \"+\" Add Trigger\n3. Choose which function to run: **main**\n4. Choose which deployment to run: **Head**\n5. Select event source: **Time-driven**\n6. Select type of time based trigger: **Day timer**\n7. Select time of day: **9am to 10am**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-lawlor%2Frenewal-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-lawlor%2Frenewal-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-lawlor%2Frenewal-notifications/lists"}