Yii Framework Forum: Send Email With Mandrillwrap - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Send Email With Mandrillwrap

#1 User is offline   medaymen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 09-July 14

Posted 11 July 2014 - 02:35 PM

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',
),Attached File  mandrillwrap.php (1.19K)
Number of downloads: 7
0

#2 User is offline   Gregurco 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 52
  • Joined: 12-August 14

Posted 29 August 2014 - 03:51 AM

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


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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users