<?php
$a = \S::get( 'a' );

if ( $a == 'newsletter-preview' )
{ 
  $dates = explode( ' - ', \S::get( 'dates' ) );
  $template = \S::get('template');
  
  echo \admin\view\Newsletter::preview(
            \admin\factory\Articles::articles_by_date_add( $dates[0], $dates[1] ),
            \admin\factory\Settings::settings_details(),
            \admin\factory\Newsletter::email_template_detalis( $template ),
            \S::get( 'dates' )
          );
  exit;
}