You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using resque mailer to send email with a pdf attachment created on the fly.
This is the code in the controller:
begin
Notifier.send_contract(params[:struttura],@contract,@struttura).deliver_now
rescue => e
Rails.logger.error("Error #{e.inspect} ")
end
This is the mailer method:
def send_contract(params,contract,struttura)
@contract=contract
@struttura=struttura
[email protected]
mail(:to => recipient, :subject => "Registrazione e Attivazione - #{struttura.nome}") do |format|
format.html # renders send_report.text.erb for body of email
format.pdf do
attachments['Contratto.pdf'] = WickedPdf.new.pdf_from_string(
render_to_string(:pdf => 'Contratto,:template => 'contracts/show.pdf.erb',locals: {:@params => params,:@contract => contract})
)
end
end
end
And presumably this works fine if you yank ResqueMailer from your mailer? If so, can you post a simple example project and I'll try to find time to take a look? txx
I'm using resque mailer to send email with a pdf attachment created on the fly.
This is the code in the controller:
This is the mailer method:
I'm obtaining the following error:
Errore #<Encoding::UndefinedConversionError: "\xD3" from ASCII-8BIT to UTF-8> ["/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:34:in
encode'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:34:into_json'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:34:in
to_json_with_active_support_encoder'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/json/encoding.rb:57:into_json'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/json-1.8.6/lib/json/common.rb:223:in
generate'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/json-1.8.6/lib/json/common.rb:223:ingenerate'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/json/encoding.rb:101:in
stringify'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/json/encoding.rb:35:inencode'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/json/encoding.rb:22:in
encode'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/core_ext/object/json.rb:37:into_json_with_active_support_encoder'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/multi_json-1.12.1/lib/multi_json/adapters/json_common.rb:19:in
dump'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/multi_json-1.12.1/lib/multi_json/adapter.rb:25:indump'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/multi_json-1.12.1/lib/multi_json.rb:139:in
dump'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/resque-1.27.4/lib/resque.rb:34:inencode'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/resque-1.27.4/lib/resque.rb:271:in
push'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/resque-1.27.4/lib/resque/job.rb:95:increate'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/resque-1.27.4/lib/resque.rb:372:in
enqueue_to'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/resque-1.27.4/lib/resque.rb:353:inenqueue'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/resque_mailer-2.4.3/lib/resque_mailer.rb:142:in
deliver'", "/Users/acirulli/Documents/Personal/BWave/SHB/development/shb/bitbucket/shb/shb/app/controllers/strutturas_controller.rb:54:increate'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/implicit_render.rb:4:in
send_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:198:inprocess_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/rendering.rb:10:in
process_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:20:inblock in process_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:117:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:555:inblock (2 levels) in compile'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:505:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:92:in__run_callbacks__'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in
_run_process_action_callbacks'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:inrun_callbacks'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/callbacks.rb:19:in
process_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/rescue.rb:29:inprocess_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/instrumentation.rb:32:in
block in process_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:inblock in instrument'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in
instrument'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:ininstrument'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/instrumentation.rb:30:in
process_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/params_wrapper.rb:250:inprocess_action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/abstract_controller/base.rb:137:in
process'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionview-4.2.7.1/lib/action_view/rendering.rb:30:inprocess'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal.rb:196:in
dispatch'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal/rack_delegation.rb:13:indispatch'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_controller/metal.rb:237:in
block in action'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:74:indispatch'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:43:in
serve'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:43:inblock in serve'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:in
each'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/journey/router.rb:30:inserve'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/routing/route_set.rb:817:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/omniauth-1.4.0/lib/omniauth/strategy.rb:186:in
call!'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/omniauth-1.4.0/lib/omniauth/strategy.rb:164:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/omniauth-1.4.0/lib/omniauth/strategy.rb:186:incall!'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/omniauth-1.4.0/lib/omniauth/strategy.rb:164:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/rack/agent_hooks.rb:30:in
traced_call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/rack/browser_monitoring.rb:32:in
traced_call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/warden-1.2.7/lib/warden/manager.rb:36:in
block in call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/warden-1.2.7/lib/warden/manager.rb:35:incatch'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/warden-1.2.7/lib/warden/manager.rb:35:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/etag.rb:24:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/conditionalget.rb:38:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/head.rb:13:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/remotipart-1.3.1/lib/remotipart/middleware.rb:32:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/params_parser.rb:27:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/flash.rb:260:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:225:in
context'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/session/abstract/id.rb:220:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/cookies.rb:560:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:29:inblock in call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in
run_callbacks'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in_run_call_callbacks'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in
run_callbacks'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:27:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/reloader.rb:73:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/remote_ip.rb:78:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/show_exceptions.rb:30:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:38:incall_app'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:20:in
block in call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:68:inblock in tagged'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:26:in
tagged'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/tagged_logging.rb:68:intagged'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:20:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/request_id.rb:21:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/methodoverride.rb:22:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/runtime.rb:18:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.7.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/lock.rb:17:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/static.rb:120:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/sendfile.rb:113:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:518:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:165:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/newrelic_rpm-4.2.0.334/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/lock.rb:17:incall'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/content_length.rb:15:in
call'", "/Users/acirulli/.rvm/gems/ruby-2.3.0/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:inservice'", "/Users/acirulli/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:140:in
service'", "/Users/acirulli/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:96:inrun'", "/Users/acirulli/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:296:in
block in start_thread'"]`Everything is working just fine for other email that don't include pdf.
The text was updated successfully, but these errors were encountered: