Send Email With Mandrillwrap


(Mohamedaymen Mastouri) #1

I will send an email with mondrillwrap, but I get the error

Non-static method Mandrill::call() should not be called statically, assuming $this from incompatible context

thanks for your help

//create action

public function actionCreate() {

    $email = Yii::app()->mandrillwrap;


    $model = new User;


    $this->performAjaxValidation($model);





    if (isset($_POST['User'])) {


        $email->subject = "test";


        $email->fromName = "user1";


        $email->fromEmail = "user1@test.com";


        $email->toName = "user2";


        $email->toEmail = "user2@test.com";


        $model->attributes = $_POST['User'];


        if ($model->save()) {


        $email->sendEmail();


       $this->redirect(array('view', 'id' => $model->user_id));       }}


    $this->render('create', array('model' => $model,


    ));


}

//main.php

‘mandrillwrap’ => array(

          'class' => 'ext.mandrillwrap.mandrillwrap',

),5740

mandrillwrap.php


(Gregurco Vlad) #2

Yii::import('application.vendors.mandrill.Mandrill');

Do you have mandrill in folder vendors? Do you use composer to get it?