mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Add mailer and emails for contributor invitations
This commit is contained in:
parent
eba5096129
commit
38f04ed461
4
app/mailers/application_mailer.rb
Normal file
4
app/mailers/application_mailer.rb
Normal file
@ -0,0 +1,4 @@
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: "from@example.com"
|
||||
layout 'mailer'
|
||||
end
|
||||
13
app/mailers/collaboration_mailer.rb
Normal file
13
app/mailers/collaboration_mailer.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class CollaborationMailer < ApplicationMailer
|
||||
default from: "collaboration@notebook.ai"
|
||||
|
||||
def contributor_invitation(inviter:, invite_email:, universe:)
|
||||
@inviter = inviter
|
||||
@universe = universe
|
||||
|
||||
mail(
|
||||
to: invite_email,
|
||||
subject: "#{@inviter.name} requested your help collaborating on Notebook.ai."
|
||||
)
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello!</h1>
|
||||
|
||||
<p>
|
||||
<%= @inviter.name %> is creating their own universes on Notebook.ai and has invited you to collaborate on their <%= link_to @universe.name, @universe %> universe.
|
||||
</p>
|
||||
<p>
|
||||
To get started, simply sign up or sign in to <%= link_to 'Notebook.ai', 'https://www.notebook.ai/users/sign_in' %> with this email address and look for "<%= @universe.name %>" under your Universes tab.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Happy worldbuilding!
|
||||
</p>
|
||||
|
||||
<br /><br /><br />
|
||||
<p style="font-size: 80%">
|
||||
Please don't respond to this email as this email address is not watched. If you have any questions, comments, concerns, or want to unsubscribe to future collaboration invitations, please send an email directly to andrew@indentlabs.com. Thank you for your understanding.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,11 @@
|
||||
Hello!
|
||||
|
||||
<%= @inviter.name %> is creating their own universes on Notebook.ai and has invited you to collaborate on their <%= @universe.name %> universe.
|
||||
|
||||
To get started, simply sign up or sign in to https://www.Notebook.ai/ with this email address and look for <%= @universe.name %> under your Universes tab. You can also navigate directly to the universe at https://www.notebook.ai<%= universe_path(@universe) %> and get started from there.
|
||||
|
||||
Happy worldbuilding!
|
||||
|
||||
-
|
||||
|
||||
Please don't respond to this email as the address is not watched. If you have any questions, comments, concerns, or want to unsubscribe to future collaboration invitations, please send an email directly to andrew@indentlabs.com. Thank you for your understanding.
|
||||
5
app/views/layouts/mailer.html.erb
Normal file
5
app/views/layouts/mailer.html.erb
Normal file
@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
1
app/views/layouts/mailer.text.erb
Normal file
1
app/views/layouts/mailer.text.erb
Normal file
@ -0,0 +1 @@
|
||||
<%= yield %>
|
||||
7
test/mailers/collaboration_mailer_test.rb
Normal file
7
test/mailers/collaboration_mailer_test.rb
Normal file
@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CollaborationMailerTest < ActionMailer::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
10
test/mailers/previews/collaboration_mailer_preview.rb
Normal file
10
test/mailers/previews/collaboration_mailer_preview.rb
Normal file
@ -0,0 +1,10 @@
|
||||
# Preview all emails at http://localhost:3000/rails/mailers/collaboration_mailer
|
||||
class CollaborationMailerPreview < ActionMailer::Preview
|
||||
def contributor_invitation
|
||||
CollaborationMailer.contributor_invitation(
|
||||
inviter: User.first,
|
||||
invite_email: 'andrew@indentlabs.com',
|
||||
universe: Universe.first
|
||||
)
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user