New version 0.9 has been released! Jun 16, 2015
×

Subscribe module

Description

Subscribe module helps you to create subscribe form on frontend.


Include

use yii\easyii\modules\subscribe\api\Subscribe;


Public functions

string Subscribe::form( $options = [] )
Returns fully worked standalone html form.
$options array
  • buttonText (string)
  • buttonClass (string)
array Subscribe::create( $email )
If you using your own form, this function will be useful for manual saving subscribers.
$email string User email

examples

Subscribe::create('example@site.com');
Array
(
    [result] => success
)
IF new subscriber successfully added.
Array
(
    [result] => error
    [error] => Array
        (
            [0] => array
            [1] => of
            [2] => errors
        )

)
IF new subscriber adding failed.