-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56090 from code-dot-org/staging
DTT (Staging > Test) [robo-dtt]
- Loading branch information
Showing
6 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
7 changes: 7 additions & 0 deletions
7
dashboard/app/views/lti_mailer/lti_integration_confirmation.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |