Closed jwr03 closed 3 months ago
CustomWorkflowMailer.deliver_custom_email(nil, to: 'franz.kafka@prague.cz', subject: subject, text_body: text)
I tried that as follows and get an error
@subject = "This is a test of the workflow"
@desc = "This is the body I hope Andrew gets this!"
@to =" ***@***.***"
CustomWorkflowMailer.deliver_custom_email(nil, :to => @to, :subject => @subject, :text_body => @desc)
From: Karel Pičman @.> Sent: Wednesday, June 12, 2024 1:49 AM To: anteo/redmine_custom_workflows @.> Cc: Redmond, Jeremy W (HEALTH) @.>; Author @.> Subject: Re: [anteo/redmine_custom_workflows] Send email to address in custom field? (Issue #340)
You don't often get email from @.**@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification
ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.
CustomWorkflowMailer.deliver_custom_email(nil, to: @.***', subject: subject, text_body: text)
- Reply to this email directly, view it on GitHubhttps://github.com/anteo/redmine_custom_workflows/issues/340#issuecomment-2162156208, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMITT6FKJWRFB2YJJ4MIB4LZG7ONVAVCNFSM6AAAAABJEQJMSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSGE2TMMRQHA. You are receiving this because you authored the thread.Message ID: @.**@.>>
What version of the plugin do you use?
1.0.7 is there a newer version?
From: Karel Pičman @.> Sent: Wednesday, June 12, 2024 8:28 AM To: anteo/redmine_custom_workflows @.> Cc: Redmond, Jeremy W (HEALTH) @.>; Author @.> Subject: Re: [anteo/redmine_custom_workflows] Send email to address in custom field? (Issue #340)
You don't often get email from @.**@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification
ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.
What version of the plugin do you use?
- Reply to this email directly, view it on GitHubhttps://github.com/anteo/redmine_custom_workflows/issues/340#issuecomment-2162883446, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMITT6DJ5YHA5W4HUAU34OLZHA5EXAVCNFSM6AAAAABJEQJMSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSHA4DGNBUGY. You are receiving this because you authored the thread.Message ID: @.**@.>>
Use the latest stable release: https://github.com/anteo/redmine_custom_workflows/releases
I do really appreciate your help. We upgraded to the latest plugin. (2.1.1)
And we tried a few different variations of the code and still can’t seem to send to a custom email addresses that we hardcode.
My latest attempt is with this code and this code only in the Workflow script executable after saving observable object
@subject = "This is a test of the workflow" @desc = "This is the body I hope Andrew gets this!" @to = @.**@.> CustomWorkflowMailer.deliver_custom_email(nil, :to => @to, :subject => @subject, :text_body => @desc)
No email get sent. ☹
@.***
From: Karel Pičman @.> Sent: Wednesday, June 12, 2024 8:34 AM To: anteo/redmine_custom_workflows @.> Cc: Redmond, Jeremy W (HEALTH) @.>; Author @.> Subject: Re: [anteo/redmine_custom_workflows] Send email to address in custom field? (Issue #340)
You don't often get email from @.**@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification
ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.
Use the latest stable release: https://github.com/anteo/redmine_custom_workflows/releases
— Reply to this email directly, view it on GitHubhttps://github.com/anteo/redmine_custom_workflows/issues/340#issuecomment-2162894314, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMITT6FZATEXQAHVL7KJH43ZHA52DAVCNFSM6AAAAABJEQJMSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSHA4TIMZRGQ. You are receiving this because you authored the thread.Message ID: @.**@.>>
You will have to check log/production.log for errors too and also your mail server.
I am getting the following in the logs with latest version and adding nil as you mentioned.
/home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in run_task' /home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in
block (3 levels) in create_worker'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in loop' /home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in
block (2 levels) in create_worker'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in catch' /home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in
block in create_worker'
Error performing ActionMailer::DeliveryJob (Job ID: ec9e3218-bd17-4b8a-bc78-8da259a84a2e) from Async(mailers) in 0.25ms: ArgumentError (First argument has to be a user, was nil):
/usr/local/redmine-4.2.1/app/models/mailer.rb:37:in process' /home/redmine/.rvm/gems/ruby-2.5.1/gems/actionmailer-5.2.5/lib/action_mailer/message_delivery.rb:123:in
block in processed_mailer'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/actionmailer-5.2.5/lib/action_mailer/message_delivery.rb:122:in tap' /home/redmine/.rvm/gems/ruby-2.5.1/gems/actionmailer-5.2.5/lib/action_mailer/message_delivery.rb:122:in
processed_mailer'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/actionmailer-5.2.5/lib/action_mailer/message_delivery.rb:113:in deliver_now' /home/redmine/.rvm/gems/ruby-2.5.1/gems/actionmailer-5.2.5/lib/action_mailer/delivery_job.rb:16:in
perform'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/execution.rb:39:in block in perform_now' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:109:in
block in run_callbacks'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/i18n-1.8.11/lib/i18n.rb:314:in with_locale' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/translation.rb:9:in
block (2 levels) in instance_exec' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:118:in
block in run_callbacks'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/logging.rb:26:in block (4 levels) in <module:Logging>' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/notifications.rb:168:in
block in instrument'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/notifications/instrumenter.rb:23:in instrument' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/notifications.rb:168:in
instrument'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/logging.rb:25:in block (3 levels) in <module:Logging>' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/logging.rb:48:in
tag_logger'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/logging.rb:22:in block (2 levels) in <module:Logging>' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:118:in
instance_exec'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:118:in block in run_callbacks' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:136:in
run_callbacks'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/execution.rb:38:in perform_now' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/execution.rb:24:in
block in execute'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:109:in block in run_callbacks' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/railtie.rb:28:in
block (4 levels) in wrap' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/reloader.rb:73:in
block in wrap'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/execution_wrapper.rb:87:in wrap' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/reloader.rb:72:in
wrap'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/railtie.rb:27:in block (3 levels) in <class:Railtie>' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:118:in
instance_exec'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:118:in block in run_callbacks' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.5/lib/active_support/callbacks.rb:136:in
run_callbacks'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/execution.rb:22:in execute' /home/redmine/.rvm/gems/ruby-2.5.1/gems/activejob-5.2.5/lib/active_job/queue_adapters/async_adapter.rb:70:in
perform'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in run_task' /home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in
block (3 levels) in create_worker'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in loop' /home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in
block (2 levels) in create_worker'
/home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in catch' /home/redmine/.rvm/gems/ruby-2.5.1/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in
block in create_worker'
From: Karel Pičman @.> Sent: Thursday, June 13, 2024 1:23 AM To: anteo/redmine_custom_workflows @.> Cc: Redmond, Jeremy W (HEALTH) @.>; Author @.> Subject: Re: [anteo/redmine_custom_workflows] Send email to address in custom field? (Issue #340)
You don't often get email from @.**@.>. Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification
ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.
You will have to check log/production.log for errors too and also your mail server.
- Reply to this email directly, view it on GitHubhttps://github.com/anteo/redmine_custom_workflows/issues/340#issuecomment-2164406573, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMITT6AJBERVHEDVFCQU37DZHEUCBAVCNFSM6AAAAABJEQJMSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRUGQYDMNJXGM. You are receiving this because you authored the thread.Message ID: @.**@.>>
Hm, you're right. Fixed in the branch devel.
I have a custom field called end_user_email_address. That is the email address that a Redmine user is submitting an issue on behalf of.
That email address is assumed to be someone who does not have a Redmine account.
Is it possible to use the send email from your custom workflow to send email to the custom field's contents on CLOSE of a issue? I noticed it used the User object which in this case I am not sure would work. Thanks in advance Jeremy