<%= javascript_packs_with_chunks_tag "admin/config/smtp", defer: true %> <%= form_for(Settings::SMTP.new, url: admin_settings_smtp_settings_path, html: { data: { action: "submit->config#updateConfigurationSettings", testid: "emailServerSettings" } }) do |f| %>
<%= render partial: "admin/shared/card_header", locals: { header: "Email Server Settings (SMTP)", state: "collapse", target: "smtpSettingsBodyContainer", expanded: false } %>
<% if ForemInstance.sendgrid_enabled? %>
<%= f.check_box :own_email_server, checked: Settings::SMTP.provided_minimum_settings?, class: "crayons-checkbox" %> <%= f.label :own_email_server, class: "crayons-field__label" do %> Use my own email server <% end %>
<% end %> <% if ForemInstance.only_sendgrid_enabled? %>

As a Forem Cloud client, we provide an email server managed by the Forem team. All settings are managed by us and the from and reply email addresses are set as <%= ForemInstance.email %>. However, you can override this to use your own email server.

<% end %>
"> <% smpt_options.each do |config_key| %>
<%= admin_config_label config_key, model: Settings::SMTP %> <%= admin_config_description Constants::Settings::SMTP::DETAILS[config_key][:description] %> <%= f.text_field config_key, class: "crayons-textfield", value: Settings::SMTP.public_send(config_key), placeholder: Constants::Settings::SMTP::DETAILS[config_key][:placeholder], "data-config-target": "smtpSetting#{config_key.to_s.camelize(:upper)}" %>
<% end %>
<%= render "update_setting_button", f: f %>
<% end %>