entityform submit handler with preview I have a simple Entity Form and have added a custom submit handler:

$form['actions']['submit']['#submit'] = array('custom_submit','entityform_edit_form_submit');


That works very well. The problem is when I enable form preview before submission. My custom_submit function runs before preview is generated and not after it was confirmed.

How do I get it to run after form has been confirmed in preview?

$form['#submit']  = array(
    'custom_submit',
    'entityform_edit_form_submit'
);


does not work at all.
So this is what I found entityform module does. If preview is enabled it set $form['review']. All of my forms will have that preview set so what I did is simply:

//check if form is in preview mode and if it is then it adds my custom handler.
if(isset($form['review'])) { 
    $form['actions']['submit']['#submit'][] ='custom_submit'
}