Skip to content

Commit

Permalink
Merge pull request #56090 from code-dot-org/staging
Browse files Browse the repository at this point in the history
DTT (Staging > Test) [robo-dtt]
  • Loading branch information
deploy-code-org committed Jan 30, 2024
2 parents 3504869 + 5de8f6a commit 84973d3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions dashboard/app/controllers/lti_v1_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def create_integration
)

@integration_status = :created
LtiMailer.lti_integration_confirmation(admin_email).deliver_now
end
render 'lti/v1/integration_status'
end
Expand Down
8 changes: 8 additions & 0 deletions dashboard/app/mailers/lti_mailer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class LtiMailer < ApplicationMailer
default from: 'Code.org <noreply@code.org>'

# Email an LMS admin after they create an LTI integration
def lti_integration_confirmation(admin_email)
mail to: admin_email, subject: I18n.t('lti.integration.mailer_confirmation_subject')
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%p
= t('lti.integration.mailer_confirmation_body').html_safe
%br
%p
= t('lti.integration.mailer_confirmation_signature').html_safe
%p
Code.org
3 changes: 3 additions & 0 deletions dashboard/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,9 @@ en:
form_instructions_2: "Full guides for obtaining your LMS Client ID, using LMS/LTI integrations, and our list of supported Learning Management Systems <a href='https://code.org/contact'>can be found here.</a>"
form_instructions_3: "Not seeing your LMS in our list, or running into issues with your installation? Check out our <a href=''>guides</a>, or <a href='https://code.org/contact'>contact us</a> for additional help"
guide_instructions: "Full guides for installing and our LTI integration <a href=''>can be found here.</a> Running into issues? Feel free to <a href=''>contact us</a> for additional support."
mailer_confirmation_subject: "Code.org has completed your LMS registration request"
mailer_confirmation_body: "Great news! We’ve registered your LMS with Code.org. You should now be able to use our Code.org LMS integrations. Please feel free to review & share our <a href=''>LMS integration guides</a>, or browse our <a href=''>course offerings</a>."
mailer_confirmation_signature: "Thank you, and welcome!"
privacy_policy: "Your privacy is of utmost importance to us. Your personal information will not be used for any marketing purposes. Please see our <a href='https://code.org/contact'>Privacy Policy here</a> for more information."
success_body: "Great news! Your LMS has been registered with Code.org, and you can continue installing and using your LMS integration. You should receive a confirmation email shortly."
success_header: "Thank you for registering your LMS!"
Expand Down
12 changes: 12 additions & 0 deletions dashboard/test/mailers/lti_mailer_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'test_helper'

class LtiMailerTest < ActionMailer::TestCase
test 'lti integration confirmation' do
admin_email = 'admin@test.com'
mail = LtiMailer.lti_integration_confirmation(admin_email)

assert_equal I18n.t('lti.integration.mailer_confirmation_subject'), mail.subject
assert_equal [admin_email], mail.to
assert_equal ['noreply@code.org'], mail.from
end
end
7 changes: 7 additions & 0 deletions dashboard/test/mailers/previews/lti_mailer_preview.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class LtiMailerPreview < ActionMailer::Preview
include FactoryBot::Syntax::Methods

def lti_integration_confirmation
LtiMailer.lti_integration_confirmation("admin@test.com")
end
end

0 comments on commit 84973d3

Please sign in to comment.