<% if @mail_schedule.errors.any? %>

<%= pluralize(@mail_schedule.errors.count, "error") %> prohibited this mail_schedule from being saved:

<% end %>
<%= f.label :name %>
<%= f.text_field :name, :class => "text" %>
<%= f.label :mail_template_id %>
<%= f.select :mail_template_id, MailEngine::MailTemplate.group("path").where(:for_marketing => true).map {|t| [t.name, t.id]} %>
<%= f.label :user_group %>
<%= f.select :user_group, MailEngine::USER_MODEL.groups %>
<%= f.label :count %>
<%= f.select :count, [['Unlimited', 0]] + (1..10).to_a.map {|i| [i,i]} %>
<%= f.label :period %>
<%= f.select :period, ['once', 'daily', 'weekly', 'monthly', 'yearly'] %>
<%= f.label :first_send_at, "First Send At" %>
<%= f.datetime_select :first_send_at, :start_year => Time.now.year, :include_seconds => false, :minute_step => 15 %>
<%= f.label :available, "Available?" %>
<%= f.check_box :available %>
If you don't want to execute this schedule, leave it unchecked.
<%= f.label :default_locale, "Default Locale" %>
<%= f.select :default_locale, I18n.available_locales, :include_blank => true %>
When can find mail template for user's locale, system will send default locale template to user. If you leave this blank, system won't send mail to this kind of users.
<%= f.label :payload %>
<% MailEngine::USER_MODEL.payload_columns.each do |column| %> <%= check_box_tag "#{f.object_name}[payload][]", column, f.object.payload.try(:include?, column) %> <%= column %>
<% end %>
<%= f.submit :class => "button" %>