summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-20 19:06:19 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-20 19:06:19 +0200
commiteb0e1cc5c26275ff3e5c341404e8bc558f8312b8 (patch)
tree71f449ccd6f15422717de3ac24f87d5e888ddd79 /app/mailers
parentdf6e17e48995f25e72509986f30700d778b179b6 (diff)
parent3b27a5d45b12f6bac65da2a8e17387bfda42a2f1 (diff)
Merge branch 'develop'
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/notifications.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/app/mailers/notifications.rb b/app/mailers/notifications.rb
index 5b46f23..44a6a7a 100644
--- a/app/mailers/notifications.rb
+++ b/app/mailers/notifications.rb
@@ -42,20 +42,11 @@ class Notifications < ActionMailer::Base
mail(from: Tenant.find(GsParameter.get('DEFAULT_API_TENANT_ID')).from_field_pin_change_email, to: "#{user.email}", :subject => "Password recovery")
end
- def new_voicemail(freeswitch_voicemail_msg, attach_file = false)
- sip_account = SipAccount.find_by_auth_name(freeswitch_voicemail_msg.username)
- user = sip_account.sip_accountable
-
+ def new_voicemail(freeswitch_voicemail_msg, account, email, attach_file = false)
@voicemail = Hash.new()
- if ! user.first_name.blank?
- @voicemail[:greeting] = user.first_name
- else
- @voicemail[:greeting] = user.user_name
- end
-
@voicemail[:destination] = freeswitch_voicemail_msg.in_folder
@voicemail[:from] = "#{freeswitch_voicemail_msg.cid_number} #{freeswitch_voicemail_msg.cid_name}"
- @voicemail[:to] = sip_account.to_s
+ @voicemail[:to] = account.to_s
@voicemail[:date] = Time.at(freeswitch_voicemail_msg.created_epoch).getlocal.to_s
@voicemail[:duration] = Time.at(freeswitch_voicemail_msg.message_len).utc.strftime('%T')
@@ -67,7 +58,7 @@ class Notifications < ActionMailer::Base
attachments["#{Time.at(freeswitch_voicemail_msg.created_epoch).getlocal.strftime('%Y%m%d-%H%M%S')}-#{caller_number}.wav"] = File.read(freeswitch_voicemail_msg.file_path)
end
- mail(from: Tenant.find(GsParameter.get('DEFAULT_API_TENANT_ID')).from_field_voicemail_email, to: "#{user.email}", :subject => "New Voicemail from #{@voicemail[:from]}, received #{Time.at(freeswitch_voicemail_msg.created_epoch).getlocal.to_s}")
+ mail(from: Tenant.find(GsParameter.get('DEFAULT_API_TENANT_ID')).from_field_voicemail_email, to: email, :subject => "New Voicemail from #{@voicemail[:from]}, received #{Time.at(freeswitch_voicemail_msg.created_epoch).getlocal.to_s}")
end
def new_fax(fax_document)