![]() This commit touch a lot of lines of code with the goal to be more rigorous about JavaScript code conventions defined in the `.jshintrc`. Some modification: * Add a list of used global symbols in the corresponding section of `.jshintrc` * Use local variables instead of global in a lot of places where the keyword `var` was mistakenly forgotten * Add missing semi-colons after instructions * Add new lines at the end of files * Remove trailing whitespaces * Use newer name of some Meteor APIs, eg `addFiles` instead of `add_files` * Add missing `break` statements in `switch` blocks * Use `===` instead of `==` and `!==` instead of `!=` * Remove unused variables This commit should also fix a few bugs due to this lack of rigor. One example of that was the test `typeof navElements === "array"` that was never true because in JavaScript, `typeof [] === "object"`, we replaced this test by the `_.isArray` method provided by underscore. It might also fix some potential collision related to global variables. There is still plenty of work until Telescope code base passes jsHint validation, but at least this commit is a step in the right direction. |
||
---|---|---|
.. | ||
.npm/package | ||
i18n | ||
lib | ||
.gitignore | ||
.versions | ||
History.md | ||
package-tap.i18n | ||
package.js | ||
README.md |
Telescope Newsletter
This package schedules an automatic newsletter digest.
Install
mrt add telescope-newsletter
.- Go to the Telescope settings page and add your MailChimp API key and List ID.
Dependencies
Settings
- Show Banner:
- MailChimp API Key:
- MailChimp List ID:
- Newsletter Frequency: Choose from every day, three times a week, and once a week. Note that changes to this setting require you to restart your app to take effect.
- Posts Per Newsletter: how many posts each newsletter should contain.
Note that for this package to work properly, you'll also need to fill in the Default Email setting.
How It Works
The package works with MailChimp, which means you'll need to fill in an API key and List ID in your Telescope app's settings panel.
Every x
days, it builds a digest consisting of the top y
items posted in the past x
days that haven't yet been sent out in a newsletter.
It then creates a campaign in MailChimp and schedules it to be sent out one hour later, and sends you a confirmation email (to give you some time to check that everything looks good).
Test Routes
If you want to preview your email templates, you can do so at the following routes:
- Digest: http://localhost:3000/email/campaign
- Confirmation: http://localhost:3000/email/digest-confirmation
(Replace http://localhost:3000
with your app's URL)
Newsletter Sign-Up Banner
This package also includes a newsletter sign-up banner that uses the MailChimp API to add people to your list.