forked from lobsters/lobsters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't hardcode "Lobsters" and "lobste.rs" everywhere, use Rails.appli…
…cation.{name,domain}
- Loading branch information
Showing
23 changed files
with
140 additions
and
74 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
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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
class EmailMessage < ActionMailer::Base | ||
default :from => "nobody@lobste.rs" | ||
default :from => "#{Rails.application.name} " << | ||
"<nobody@#{Rails.application.domain}>" | ||
|
||
def notify(message, user) | ||
@message = message | ||
@user = user | ||
|
||
mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>", | ||
:subject => "[Lobsters] Private Message from " << | ||
"#{message.author.username}: #{message.subject}") | ||
mail( | ||
:to => user.email, | ||
:subject => "[#{Rails.application.name}] Private Message from " << | ||
"#{message.author.username}: #{message.subject}" | ||
) | ||
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 |
---|---|---|
@@ -1,21 +1,26 @@ | ||
class EmailReply < ActionMailer::Base | ||
default :from => "nobody@lobste.rs" | ||
default :from => "#{Rails.application.name} " << | ||
"<nobody@#{Rails.application.domain}>" | ||
|
||
def reply(comment, user) | ||
@comment = comment | ||
@user = user | ||
|
||
mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>", | ||
:subject => "[Lobsters] Reply from #{comment.user.username} on " << | ||
"#{comment.story.title}") | ||
mail( | ||
:to => user.email, | ||
:subject => "[#{Rails.application.name}] Reply from " << | ||
"#{comment.user.username} on #{comment.story.title}" | ||
) | ||
end | ||
|
||
def mention(comment, user) | ||
@comment = comment | ||
@user = user | ||
|
||
mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>", | ||
:subject => "[Lobsters] Mention from #{comment.user.username} on " << | ||
"#{comment.story.title}") | ||
mail( | ||
:to => user.email, | ||
:subject => "[#{Rails.application.name}] Mention from " << | ||
"#{comment.user.username} on #{comment.story.title}" | ||
) | ||
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
class InvitationMailer < ActionMailer::Base | ||
default :from => "#{Rails.application.name} " << | ||
"<nobody@#{Rails.application.domain}>" | ||
|
||
def invitation(invitation) | ||
@invitation = invitation | ||
|
||
mail(:to => invitation.email, | ||
:from => "Lobsters Invitation <nobody@lobste.rs>", | ||
subject: "[Lobsters] Welcome to Lobsters") | ||
mail( | ||
:to => invitation.email, | ||
subject: "[#{Rails.application.name}] Welcome to " << | ||
Rails.application.name | ||
) | ||
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
class PasswordReset < ActionMailer::Base | ||
default :from => "#{Rails.application.name} " << | ||
"<nobody@#{Rails.application.domain}>" | ||
|
||
def password_reset_link(user, ip) | ||
@user = user | ||
@ip = ip | ||
|
||
mail(:to => user.email, :from => "Lobsters <nobody@lobste.rs>", | ||
:subject => "[Lobsters] Reset your password") | ||
mail( | ||
:to => user.email, | ||
:subject => "[#{Rails.application.name}] Reset your password" | ||
) | ||
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
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
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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Hello <%= @user.email %>, | ||
|
||
Someone at <%= @ip %> requested to reset your account password | ||
on lobste.rs. If you submitted this request, visit the link below to | ||
on <%= Rails.application.name %>. If you submitted this request, visit the link below to | ||
set a new password. If not, you can disregard this e-mail. | ||
|
||
<%= root_url %>login/set_new_password?token=<%= @user.password_reset_token %> |
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
ActionMailer::Base.smtp_settings = { | ||
:address => "127.0.0.1", | ||
:port => 25, | ||
:domain => "lobste.rs", | ||
:domain => Rails.application.domain, | ||
:enable_starttls_auto => false, | ||
} |
Oops, something went wrong.