Using the Views Send module to send mass email. On the email creation page I want to set my custom validation extensions for the file field provided by Views Send in combination with MimeMail (r# 267 in views_send.module).
For the file field I am trying to set the only allowed extension to be of type .docx by using the following function:
function my_module_form_alter(&$form, &$form_state, $form_id) {
if($form_id == "views_form_views_send_page") {
if ($form_state['step'] == 'views_send_config_form') {
$form['mail']['views_send_attachments'] = array(
'#type' => 'file',
'#title' => t('Attachment'),
'#upload_validators' => array(
'file_validate_extensions' => array('docx'),
),
);
}
}
Unfortuanetely this is not working. What am I doing wrong here?