From 2e9694ea316ea5a5c5008ea0b9f8b18bb909db73 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 1 Aug 2013 13:26:58 +0200 Subject: display file name --- app/mailers/notifications.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/mailers/notifications.rb b/app/mailers/notifications.rb index 44a6a7a..ec81d35 100644 --- a/app/mailers/notifications.rb +++ b/app/mailers/notifications.rb @@ -55,7 +55,8 @@ class Notifications < ActionMailer::Base if caller_number.blank? caller_number = 'anonymous' end - 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) + @voicemail[:file_name] = "#{Time.at(freeswitch_voicemail_msg.created_epoch).getlocal.strftime('%Y%m%d-%H%M%S')}-#{caller_number}.wav" + attachments[@voicemail[:file_name]] = File.read(freeswitch_voicemail_msg.file_path) end 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}") -- cgit v1.2.3