forked from foodcoops/foodsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previous behavior: The order email sent to the supplier will be sent as a copy (CC) to the user* and the supplier will be request to send any replies to that user*. *user: If sent by clicking on the "Send to supplier" button, the user who clicked the button; if sent automatically by end action, the user who created the order. New behavior: In Administration/Configuration, there's a new tab "Suppliers" where admins can set options for communication with suppliers. The default by migration is: The order email sent to the supplier will be sent as a copy (CC) to the associated users* and the supplier will be requested to send any replies to them. *associated users: both a) the user who created the order and b) (unless it was auto-sent) the user who clicked the button "Send to supplier." The copy of the email to the supplier can be changed to blind copy (BCC, default for new instances) or no copy at all. If a reply-to address is set, the supplier will be requested to send any replies to that address instead. If the "send reply copy" option below is checked, there will be multiple reply-to addresses: the specified address and the associated user(s) Old behavior: If not a single article has been ordered, the empty order will be sent to the supplier anyway (unless a minimum order quantity has been set and the respective end action been selected.) New behavior: Not to disrupt any workflows, this behavior remains the same if "Close the order and send it to the supplier" selected, but is pointed out now by the affix "(even if nothing has been ordered.)" There's a new option "Close the order and send it to the supplier unless nothing has been ordered." This checks if at least one article has been ordered (i.e. 1 box filled.) The behavior of "Close the order and send it to the supplier if the minimum quantity has been reached" is changed slightly: It also checks if at least one article has been ordered. This makes it a good general option that fulfills most use cases, so you don't have to memorize whether a minimum order quantity has been set for each supplier. TO DO: - The "send reply copy" checkbox should only collapse if the email field above is filled. I didn't manage to solve this (yet) -- can somebody help me? - I could only test the "unless nothing ordered" code indirectly, as the end actions didn't work in my local environment. The check worked in another method, but it should be tested if this exact code actually works (both for auto_close_and_send_min_quantity and auto_close_and_send_unless_empty.)
- Loading branch information
1 parent
8b4c36e
commit 608466a
Showing
12 changed files
with
148 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%fieldset | ||
%label | ||
%h4= t '.communication_with_suppliers' | ||
- mail_order_result_copy_to_user_options = FoodsoftConfig::MailOrderResultCopyToUser.constants.map { |c| FoodsoftConfig::MailOrderResultCopyToUser.const_get(c) } | ||
= config_input form, :mail_order_result_copy_to_user, as: :select, collection: mail_order_result_copy_to_user_options, | ||
include_blank: false, input_html: {class: 'input-xxlarge'}, value_method: ->(s){ s }, label_method: ->(s){ t("config.keys.mail_order_result_copy_to_user_options.#{s}") } | ||
= config_input form, :order_result_email_reply_to, as: :string, input_html: {class: 'input-xlarge', placeholder: "#{@cfg[:name]} <#{@cfg[:contact][:email]}>"} | ||
= config_input form, :order_result_email_reply_copy_to_user, as: :boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,19 @@ default: &defaults | |
# email address to be used as sender | ||
email_sender: [email protected] | ||
|
||
|
||
# Options for communication between suppliers, the foodcoop, and order-associated users: | ||
# Associated users are a) the user who created the order and b) (unless it was auto-sent) the user who clicked the button "Send to supplier." | ||
|
||
# Mail order results only to the supplier (no_copy), as copy to associated user(s) (cc), or as blind copy to associated user(s) (bcc). | ||
mail_order_result_copy_to_user: bcc | ||
|
||
# Enter an email address if you want to request your suppliers to send any replies to that address instead of the associated users': | ||
# order_result_email_reply_to: Foodcoop <[email protected]> | ||
# If you want replies to be sent to both the specified reply-to address and the associated users': | ||
# order_result_email_reply_copy_to_user: true | ||
|
||
|
||
# domain to be used for reply emails | ||
#reply_email_domain: reply.foodcoop.test | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
db/migrate/20240424015646_add_mail_order_result_copy_to_user_setting.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class AddMailOrderResultCopyToUserSetting < ActiveRecord::Migration[7.0] | ||
def up | ||
FoodsoftConfig[:mail_order_result_copy_to_user] = FoodsoftConfig::MailOrderResultCopyToUser::CC | ||
end | ||
|
||
def down | ||
FoodsoftConfig[:mail_order_result_copy_to_user] = nil | ||
FoodsoftConfig[:order_result_email_reply_to] = nil | ||
FoodsoftConfig[:order_result_email_reply_copy_to_user] = nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters