New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove smtp config from admin config page #5235
Merged
luisramos0
merged 2 commits into
openfoodfoundation:master
from
luisramos0:mail_methods
Apr 29, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,28 @@ | ||
%div | ||
.row | ||
.alpha.six.columns | ||
%fieldset.no-border-bottom | ||
%legend{align: "center"}= t("spree.general") | ||
.field | ||
= preference_field_tag("enable_mail_delivery", Spree::Config[:enable_mail_delivery], type: :boolean) | ||
= label_tag :enable_mail_delivery, t("spree.enable_mail_delivery") | ||
.field | ||
= label_tag :mails_from, t("spree.send_mails_as") | ||
%br/ | ||
= text_field_tag :mails_from, Spree::Config[:mails_from], maxlength: 256, class: 'fullwidth' | ||
%br/ | ||
%span.info | ||
= t("spree.smtp_send_all_emails_as_from_following_address") | ||
.field | ||
= label_tag :mail_bcc, t("spree.send_copy_of_all_mails_to") | ||
%br/ | ||
= text_field_tag :mail_bcc, Spree::Config[:mail_bcc], maxlength: 256, class: 'fullwidth' | ||
%br/ | ||
%span.info | ||
= t("spree.smtp_send_copy_to_this_addresses") | ||
.field | ||
= label_tag :intercept_email, t("spree.intercept_email_address") | ||
%br/ | ||
= text_field_tag :intercept_email, Spree::Config[:intercept_email], maxlength: 256, class: 'fullwidth' | ||
%br/ | ||
%span.info | ||
= t("spree.intercept_email_instructions") | ||
.six.columns.omega | ||
%fieldset.no-border-bottom | ||
%legend{align: "center"}= t("spree.smtp") | ||
.field | ||
= label_tag :mail_domain, t("spree.smtp_domain") | ||
%br/ | ||
= text_field_tag :mail_domain, Spree::Config[:mail_domain], class: 'fullwidth' | ||
.field | ||
= label_tag :mail_host, t("spree.smtp_mail_host") | ||
%br/ | ||
= text_field_tag :mail_host, Spree::Config[:mail_host], class: 'fullwidth' | ||
.field | ||
= label_tag :mail_port, t("spree.smtp_port") | ||
%br/ | ||
= text_field_tag :mail_port, Spree::Config[:mail_port], class: 'fullwidth' | ||
.field | ||
= label_tag :secure_connection_type, t("spree.secure_connection_type") | ||
%br/ | ||
= select_tag(:secure_connection_type, options_from_collection_for_select(Spree::Core::MailSettings::SECURE_CONNECTION_TYPES.map{|w| Spree.t(w.downcase.to_sym, default: w)}, :to_s, :to_s, Spree::Config[:secure_connection_type]), class: 'select2 fullwidth') | ||
.field | ||
= label_tag :mail_auth_type, t("spree.smtp_authentication_type") | ||
%br/ | ||
= select_tag(:mail_auth_type, options_from_collection_for_select(Spree::Core::MailSettings::MAIL_AUTH.map{|w| Spree.t(w.downcase.to_sym, default: w)}, :to_s, :to_s, Spree::Config[:mail_auth_type]), class: 'select2 fullwidth') | ||
.field | ||
= label_tag :smtp_username, t("spree.smtp_username") | ||
%br/ | ||
= text_field_tag :smtp_username, Spree::Config[:smtp_username], class: 'fullwidth' | ||
.field | ||
= label_tag :preferred_smtp_password, t("spree.smtp_password") | ||
%br/ | ||
= password_field_tag :smtp_password, Spree::Config[:smtp_password], class: 'fullwidth' | ||
%fieldset.no-border-bottom | ||
%legend{align: "center"}= t("spree.general") | ||
.field | ||
= preference_field_tag("enable_mail_delivery", Spree::Config[:enable_mail_delivery], type: :boolean) | ||
= label_tag :enable_mail_delivery, t("spree.enable_mail_delivery") | ||
.field | ||
= label_tag :mails_from, t("spree.send_mails_as") | ||
%br/ | ||
= text_field_tag :mails_from, Spree::Config[:mails_from], maxlength: 256, class: 'fullwidth' | ||
%br/ | ||
%span.info | ||
= t("spree.smtp_send_all_emails_as_from_following_address") | ||
.field | ||
= label_tag :mail_bcc, t("spree.send_copy_of_all_mails_to") | ||
%br/ | ||
= text_field_tag :mail_bcc, Spree::Config[:mail_bcc], maxlength: 256, class: 'fullwidth' | ||
%br/ | ||
%span.info | ||
= t("spree.smtp_send_copy_to_this_addresses") | ||
.field | ||
= label_tag :intercept_email, t("spree.intercept_email_address") | ||
%br/ | ||
= text_field_tag :intercept_email, Spree::Config[:intercept_email], maxlength: 256, class: 'fullwidth' | ||
%br/ | ||
%span.info | ||
= t("spree.intercept_email_instructions") |
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,16 @@ | ||
class DropMailMethods < ActiveRecord::Migration | ||
def up | ||
drop_table :spree_mail_methods | ||
|
||
# delete mail_method preferences associated with the old MailMethod model | ||
execute "DELETE FROM spree_preferences WHERE key LIKE 'spree/mail_method%'" | ||
end | ||
|
||
def down | ||
create_table :spree_mail_methods do |t| | ||
t.string :environment | ||
t.boolean :active, default: true | ||
t.timestamps | ||
end | ||
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will skip smtp_username and smtp_password though. Is that what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I think smtp_username and smtp_password are the values set in MailConfiguration and used in MailSettings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, got it. These are old Spree preference and not ours. I wasn't sure what you were aiming at.