lib/openwfe/participants/enoparticipants.rb in openwferu-0.9.13 vs lib/openwfe/participants/enoparticipants.rb in openwferu-0.9.14

- old
+ new

@@ -73,10 +73,13 @@ # is taken from the workitem's <tt>email_target</tt> field. So, to have # the email sent to "foo@nowhere.com", set your workitem's # <tt>email_target</tt> field to "foo@nowhere.com" prior to feeding it # to the mail participant. # + # Likewise, you can also override the :from_address value by setting the + # workitems <tt>email_from</tt> field. + # # When passing the mail template as a block, you have # four possible arities : # { |workitem| ... } # { |participant_expression, workitem| ... } # { |participant_expression, participant_instance, workitem| ... } @@ -125,16 +128,18 @@ OpenWFE::dosub(template, fe, workitem) else "(no template given)" end + from_address = workitem.email_from rescue @from_address + puts "msg >>>\n#{msg}<<<" # # 2. Send message Net::SMTP.start(@smtp_server, @smtp_port) do |smtp| - smtp.send_message(msg, @from_address, to_address) + smtp.send_message(msg, from_address, to_address) end # # 3. Reply to engine