Why: Newsletter attribute `segment_recipient` is an integer to be used as enum. There's no advantage to store a number instead of an string if the ammount of elements in the table is not going to be huge, or we can take advantage of using an enum. Also maintaining both Newsletters enum paired with UserSegments::SEGMENTS would be a maintenance burden. How: * Migration to change segment_recipient column from integer to string * Removing enumeration from Newsletter model class * Using UserSegments::SEGMENTS instead of Newsletter.segment_recipients or integer values
20 lines
684 B
Plaintext
20 lines
684 B
Plaintext
<h2 class="inline-block"><%= t("admin.emails_download.index.title") %></h2>
|
|
|
|
<div class="small-6">
|
|
<%= form_tag generate_csv_admin_emails_download_index_path,
|
|
method: :get,
|
|
id: "admin_download_emails" do %>
|
|
|
|
<label><%= t('admin.emails_download.index.download_segment') %></label>
|
|
<p class="help-text" id="emails-help-text">
|
|
<%= t('admin.emails_download.index.download_segment_help_text') %>
|
|
</p>
|
|
|
|
<%= select_tag :users_segment, options_for_select(user_segments_options) %>
|
|
|
|
<div class="margin-top">
|
|
<%= submit_tag t('admin.emails_download.index.download_emails_button'), class: "button" %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|