Skip to content

Commit 94c1e2b

Browse files
committed
Add new organization request mailer
1 parent 558f715 commit 94c1e2b

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class NewOrganizationRequestMailer < ActionMailer::Base
2+
def request_email(organization)
3+
email = SiteSetting.value('administrative_email')
4+
if email.empty?
5+
Rails.logger.warn 'Not sending a notification on a new organization because administrative_email is not defined. '
6+
end
7+
@organization = organization
8+
@creator = organization.creator
9+
mail(to: email, subject: 'New TestMyCode Organization Request')
10+
end
11+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Hey there,
2+
3+
Someone just requested a new TestMyCode organization!
4+
5+
Requested organization:
6+
Name: "<%= @organization.name %>"
7+
Details: "<%= @organization.information %>"
8+
Slug: "<%= @organization.slug %>"
9+
Contact information: "<%= @organization.contact_information %>"
10+
Phone: "<%= @organization.phone %>"
11+
12+
Here is some basic information on the request initiator:
13+
Username: "<%= @creator.login %>"
14+
Account created: "<%= @creator.created_at %>"
15+
Email: "<%= @creator.email %>"
16+
17+
Please react to this request as soon as possible.
18+
19+
Your faithful server,
20+
TMC-server

config/site.defaults.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ emails:
7878
7979
email_code_reviews_by_default: false
8080

81+
# Used for email notifications intended for site admins
82+
administrative_email: ""
8183

8284
### Enable or disable features ###
8385

0 commit comments

Comments
 (0)