Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging in changes from master, adding back test_app - but just the t…
…est files
- Loading branch information
Showing
32 changed files
with
459 additions
and
313 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
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,44 +1,43 @@ | ||
# Only works for documents with a #to_marc right now. | ||
class RecordMailer < ActionMailer::Base | ||
|
||
|
||
def email_record(documents, details, from_host, host) | ||
#raise ArgumentError.new("RecordMailer#email_record only works with documents with a #to_marc") unless document.respond_to?(:to_marc) | ||
|
||
recipients details[:to] | ||
if documents.size == 1 | ||
subject = "Item Record: #{documents.first.to_marc['245']['a'] rescue 'N/A'}" | ||
else | ||
subject = "Item records" | ||
end | ||
|
||
@documents = documents | ||
@message = details[:message] | ||
@host = host | ||
|
||
mail(:to => details[:to], :from => "no-reply@" << from_host, :subject => subject) | ||
|
||
end | ||
|
||
def sms_record(documents, details, from_host, host) | ||
if sms_mapping[details[:carrier]] | ||
to = "#{details[:to]}@#{sms_mapping[details[:carrier]]}" | ||
end | ||
@documents = documents | ||
@host = host | ||
mail(:to => to, :from => "no-reply@" << from_host, :subject => "") | ||
end | ||
|
||
protected | ||
|
||
def sms_mapping | ||
{'virgin' => 'vmobl.com', | ||
'att' => 'txt.att.net', | ||
'verizon' => 'vtext.com', | ||
'nextel' => 'messaging.nextel.com', | ||
'sprint' => 'messaging.sprintpcs.com', | ||
'tmobile' => 'tmomail.net', | ||
'alltel' => 'message.alltel.com', | ||
'cricket' => 'mms.mycricket.com'} | ||
end | ||
end | ||
# Only works for documents with a #to_marc right now. | ||
class RecordMailer < ActionMailer::Base | ||
|
||
def email_record(documents, details, from_host, url_gen_params) | ||
#raise ArgumentError.new("RecordMailer#email_record only works with documents with a #to_marc") unless document.respond_to?(:to_marc) | ||
|
||
recipients details[:to] | ||
if documents.size == 1 | ||
subject = "Item Record: #{documents.first.to_marc['245']['a'] rescue 'N/A'}" | ||
else | ||
subject = "Item records" | ||
end | ||
|
||
@documents = documents | ||
@message = details[:message] | ||
@url_gen_params = url_gen_params | ||
|
||
mail(:to => details[:to], :from => "no-reply@" << from_host, :subject => subject) | ||
end | ||
|
||
def sms_record(documents, details, from_host, url_gen_params) | ||
if sms_mapping[details[:carrier]] | ||
to = "#{details[:to]}@#{sms_mapping[details[:carrier]]}" | ||
end | ||
@documents = documents | ||
@host = host | ||
@url_gen_params = url_gen_params | ||
mail(:to => to, :from => "no-reply@" << from_host, :subject => "") | ||
end | ||
|
||
protected | ||
|
||
def sms_mapping | ||
{'virgin' => 'vmobl.com', | ||
'att' => 'txt.att.net', | ||
'verizon' => 'vtext.com', | ||
'nextel' => 'messaging.nextel.com', | ||
'sprint' => 'messaging.sprintpcs.com', | ||
'tmobile' => 'tmomail.net', | ||
'alltel' => 'message.alltel.com', | ||
'cricket' => 'mms.mycricket.com'} | ||
end | ||
end |
Oops, something went wrong.