first commit
This commit is contained in:
38
autoload/front/controls/class.Newsletter.php
Normal file
38
autoload/front/controls/class.Newsletter.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
|
||||
class Newsletter
|
||||
{
|
||||
public static function signin()
|
||||
{
|
||||
$result = [ 'status' => 'bad' ];
|
||||
|
||||
if ( \front\factory\Newsletter::newsletter_signin( \S::get( 'email' ) ) )
|
||||
$result = [ 'status' => 'ok' ];
|
||||
|
||||
echo json_encode( $result );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function confirm()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\Newsletter::newsletter_confirm( \S::get( 'hash' ) ) )
|
||||
\S::alert( $lang['email-zostal-dodany-do-listy-newsletter'] );
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function unsubscribe()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\Newsletter::newsletter_unsubscribe( \S::get( 'hash' ) ) )
|
||||
\S::alert( $lang['email-zostal-usuniety-z-listy-newsletter'] );
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user