Commit Graph

25 Commits

Author SHA1 Message Date
Brian Palmer 70639150ba api: translate absolute paths to full urls with the canvas host
This fixes image links to /equation_images/X, among other things.

As part of this, I refactored the attachment.rb secure setting to be a
domain.yml (HostUrl) setting that can be used app-wide to determine
whether to use http or https when the code doesn't have access to a Request.

Fixes #8784

I also started down the road of having notification emails/sms/etc use
https links instead of http, but there is still work to do there, refs #9190

test plan: Use the rich text editor to post to a discussion or any other
rich text field that can be retrieved via the api, and include an
equation using the equation editor. Then retrieve that post through the
api, and verify that the url to the equation image includes the canvas
hostname and protocol (http://canvas.example.com/equation_images/X
instead of just /equation_images/X)

Change-Id: Iac28bf99d2d3b33c17d5b3eb128aa6d8488570fe
Reviewed-on: https://gerrit.instructure.com/11867
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-07-02 09:53:59 -06:00
Cameron Matheson b9e014ce86 notifications: allow including extra data for messages
refs #7771

This adds a 'data' block to broadcast_policy definitions.  The data
block should return a hash which will be turned into a struct named
'data' that is accessible in the message templates

Change-Id: I3c6d76577a1a1ba0f832669a4196fc8fae609058
Reviewed-on: https://gerrit.instructure.com/9720
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-04-18 17:08:13 -06:00
Cody Cutrer 0a4bae9b84 use global ids for message reply to addresses fixes #7723
test plan:
 * send someone a message on another shard
 * reply to that message
 * it should be added to the conversation

Change-Id: Id4439bd63f8805660d302a04e54bd47f304e29b2
Reviewed-on: https://gerrit.instructure.com/9545
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-03-22 16:34:26 -06:00
Brian Palmer f57f7a674b don't dispatch cancelled messages, fixes #7397
test plan:
  * perform an action that generates a delayed message, like grading an
    assignment
  * change the grade on the assignment to generate another message
  * wait 30 minutes, and very you only got the second message

Change-Id: I7aeccfb9db705ed3403e8927776a039403cabf27
Reviewed-on: https://gerrit.instructure.com/8944
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-02-24 12:21:21 -07:00
Jon Jensen a41081cf22 fix dashboard notifications for appointments
display stream items for new and updated appointment groups, as well as
when someone signs up another user (e.g. group signup)

removed unused message templates, fixed date_string range to just show a
single date if date parts are the same

test plan:

1. publish an appointment group and ensure all pertinent students get a
dashboard notification
2. add times to an appointment group and ensure all pertinent students
get a dashboard notification
3. sign up a group for a timeslot and ensure all other group members
get a dashboard notification

Change-Id: Id0dec52c0376fb6e14b0f26bb60e4695b25f7591
Reviewed-on: https://gerrit.instructure.com/7938
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-01-10 13:40:25 -07:00
Cody Cutrer 2b2f49d66f search for communication channels case insensitively fixes #6750
test plan:
 * create a user via SIS import with an e-mail address
 * add a different e-mail address to the user
 * re-import the user via SIS, and set their e-mail address
   to the second e-mail you added, but with a different case
 * the user should have a single e-mail address, the one set
   in the second SIS import

Change-Id: Iab6b16e0b37cfb8caac3faa453be570b99621a9e
Reviewed-on: https://gerrit.instructure.com/7784
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2011-12-30 19:36:29 -07:00
Jon Jensen f97772ae0d fix wrong hostname in message emails
root account is now tracked as the ConversationMessage#context

this also fixes a bug where these emails didn't include the footer

Change-Id: If5db3839f65fc68625497a7c8d2ee0f0be682115
Reviewed-on: https://gerrit.instructure.com/5246
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-24 15:30:37 -06:00
Cody Cutrer caae827136 alerts, closes #4317
* Daily job to evaluate alerts
   * Spawns a new job for each root account (for parallelization).
     It could be broken down to per-course level if needed (i.e.
     if there is a *huge* root account).
   * Evaluating criteria at a course level using efficient queries.
 * UI for CRUD on alerts
   * Render existing alerts
   * Delete existing alerts
   * Create a new alert
   * CRUD for criteria, recipients, repetition
   * Validations
 * Improve instructure_helper's formErrors to support passing errors
   for specific elements
 * Improve Rails' :include to be able to :exclude an :include
   inherited from a named scope
 * Specs!!
 * Note that we want to slowly roll this out, so there is a setting on
   root accounts to enable it

So I ran an alert with just an interaction criterion on a test
cluster against 50,000 courses, and it took less than 10 minutes
without any parallelization.  That seems like acceptable
performance to me (since there are only just over 3000 courses
in production that would even be elligible to have alerts sent
right now).  Of course, that's probably skewed because I'm sure
a bunch of those 50,000 courses were essentially empty.

Change-Id: Ie028ef206c9155b9a72fb2a820f3e0e516de562a
Reviewed-on: https://gerrit.instructure.com/4799
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-24 10:19:44 -06:00
JT Olds d5c8be2ca0 allow for configuration of outgoing email name
Change-Id: I87587c291801f39697e8dd691d6be9b3b396b86b
Reviewed-on: https://gerrit.instructure.com/4746
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-07-21 13:33:16 -06:00
Cody Cutrer 3bd7ac199b i18n enrollment_*.erb
also make ERB::Util (ERB::Util#h, specifically) available to messages.

Change-Id: I01621b3564182cacee0e52118cb6e7c5ded71e4b
Reviewed-on: https://gerrit.instructure.com/4493
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-30 11:11:28 -06:00
Bracken Mosbacker 6c6147b350 i18n assignment messages
make it stop.

Change-Id: I07ac240d0def58730dc2fe2135605543884158ec
Reviewed-on: https://gerrit.instructure.com/4494
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-06-30 10:42:47 -06:00
Jon Jensen b43dd2fd06 fix overzealous escaping of facebook message html
Change-Id: If849252b4285bfed6e8a14aa11bacfe967a25cc7
Reviewed-on: https://gerrit.instructure.com/4486
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-06-29 17:03:28 -06:00
JT Olds cfab93c9b5 notification category i18n reminders
Change-Id: I034fa38e582f862df27a60c689d592ffff8fa26f
Reviewed-on: https://gerrit.instructure.com/4224
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-06-16 08:49:40 -06:00
Brian Whitmer 2c5c268982 add twitter to notification preferences
Twitter recently stopped offering whitelist
exceptions for things like direct messaging.  We are
trying to work around the limitations by having
a user direct message themselves instead of having
some global account user that direct messages everyone.

Also added a "short_host" method for HostUrl that
in the future we can use to generate short-ish links
to include in tweets.  For now the links are somewhat
short, at least.

refs #4045

Change-Id: Iad59b979b166d572827a8ce16d3f9fcdd57d512d
Reviewed-on: https://gerrit.instructure.com/2938
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-06-14 11:57:48 -06:00
Jon Jensen 58a25bd462 preliminary i18n setup, closes #4124
* i18n key scoping for controller/model/js/etc.
 * inline English translation support
 * rdiscount gem for markdown'ed translations
 * html_safe interpolation tweaks
 * label helpers
 * crummy tweak to translate symbol keys
 * internationalized most of lib, and some plugins/messages
 * conference i18n (view/model/controller/js)

Change-Id: I42772b9e19a110efbe855dc83a681be49ec98df2
Reviewed-on: https://gerrit.instructure.com/4080
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-06 14:19:03 -06:00
Cody Cutrer bdbebfaec8 check all models for protecting attributes refs #3847
Change-Id: I7cba6e26ad98e91723e2ccf0a28b8db79bb37b5c
Reviewed-on: https://gerrit.instructure.com/3631
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-25 17:38:50 -06:00
Brian Palmer b657f4e959 generate an error report for all errors, not just some of them
refs #4487

This consolidates our ErrorReport class with our ErrorLogging mechanism,
it's all in ErrorReport now and you call ErrorReport.log_error or
ErrorReport.log_exception to both create an ErrorReport object, and call
the hooks similar to what ErrorLogging did so that plugins for other
error handling mechanisms can be injected.

ErrorReport has a category field now, similar to how ErrorLogging used
to take a type. the /error_reports UI can filter by category.

The plugin interface was designed with Hoptoad integration in mind, but
it should be pretty general.

Change-Id: I59f7a0d44cf4b6215ad13ff92d30e1d1af607b74
Reviewed-on: https://gerrit.instructure.com/3577
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 10:36:56 -06:00
Zach Wily d4d138016b mark message as sent when sending to facebook
Change-Id: I72323c86b078023b631710005060d57964a6d9eb
Reviewed-on: https://gerrit.instructure.com/3592
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 07:20:58 -06:00
Brian Whitmer 2782f0749c fix for facebook dashboard increment
Change-Id: I5f61d3ac571c20e3b63148b6170fb1d9e214ee38
Reviewed-on: https://gerrit.instructure.com/3588
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-10 22:09:13 -06:00
Brian Whitmer 8dca8a0d19 update facebook integration to oauth 2
This should allow open source installs to now set up
their own Facebook apps if desired.  The facebooker
gem is no longer required and configuration now
happens in a plugin instead of a yml file.

fixes #4509

Change-Id: Iec76dc8c31f0ad0276e992319f368826baa4ccc5
Reviewed-on: https://gerrit.instructure.com/3545
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-10 16:18:23 -06:00
Cody Cutrer 63bad32df0 Handle incoming mails. Closes #4016.
* Uses Mailman gem
 * Can be configured for POP3, Maildir, or stdin (push from mailserver)
 * Maildir can be chained with fetchmail or similar to support IMAP
 * Can be run as part of the job server, or as a separate process

Change-Id: I000000000000000000000000000001
Reviewed-on: https://gerrit.instructure.com/2971
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-07 10:46:11 -06:00
Brian Whitmer b17c00abdd set "from_name" to user's name for private messages
Right now emails get sent to users with the from_name
"Instructure Canvas" instead of the sender's name.
In other cases we try to use the course/group name,
so it makes sense to use the user name in this case.

refs #4171

Change-Id: Iec17edfbcf15fb06b089f2556b3b100f78642f9c
Reviewed-on: https://gerrit.instructure.com/2945
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-05 15:28:45 -06:00
Zach Wily 16eecfd4dc fix escaping in messages, refs #3888
It's unnecessary to html unescape the subject and body anymore, as they are
already unescaped.

Change-Id: I10b13805a42c677e1309983c77f1aa62e56e8578
Reviewed-on: https://gerrit.instructure.com/2413
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-02-23 14:37:42 -07:00
Brian Palmer 4115014102 deliver messages to all recipients in one job, closes #1
If any individual message delivery fails, we'll reschedule it as its own
individual job.

Change-Id: I51ae5941fd001c61e6c6b708185ff12585d0a49f
Reviewed-on: https://gerrit.instructure.com/2390
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-02-22 16:23:58 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00