function newsletter_list_edit_submit in Newsletter 7
Same name and namespace in other branches
- 7.2 modules/list/includes/newsletter_list.admin.inc \newsletter_list_edit_submit()
File
- includes/
newsletter.admin.inc, line 798 - Admin page callbacks for the newsletter module.
Code
function newsletter_list_edit_submit($form, &$form_state) {
$list = (object) $form_state['values'];
$list->send_rate = $list->send_rate == 'Custom' ? $form_state['values']['send_rate_custom'] : $list->send_rate;
if (isset($form_state['values']['nlid'])) {
$list->id = $form_state['values']['nlid'];
}
field_attach_submit('newsletter_list', $list, $form, $form_state);
$updated = entity_get_controller('newsletter_list')
->save($list);
isset($updated) ? drupal_set_message(t('List updated successfully'), 'status') : drupal_set_message(t('An unknown error occured,please try again'), 'error');
$form_state['redirect'] = 'admin/config/media/newsletter/lists';
}