2017 © Pedro Peláez
 

libaray yii2-sendcloud

Provides Yii2 component for SendCloud email service

image

softbread/yii2-sendcloud

Provides Yii2 component for SendCloud email service

  • Sunday, January 21, 2018
  • by softbread
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

SendCloud Yii2 integration

中文文档, (*1)

This extension allows developpers to use SendCloud as an email transport. Also, you may use this extension to send SMS messages to Chinese cell phones via SendCloud. This work is inspired by yii2-sendgrid., (*2)

Installation

If you use Composer, you can update your composer.json like this :, (*3)

``` json { "require": { "softbread/yii2-sendcloud": "@dev" } }, (*4)


How to use it ------------ Add extension to your configuration ``` php return [ //.... 'components' => [ 'mailer' => [ 'class' => 'SendCloud\Mail\Mailer', 'api_user' => '<your sendcloud api-user>', 'api_key' => '<your sendcloud api-key>' ], 'sendSms' => [ 'class' => 'SendCloud\Sms\SendSms', 'apiUser => '<your SMS api-user>', 'apiKey => '<your SMS api-key>' ], ], ];

You can send email via SendCloud as mailer component, (*5)

``` php Yii::$app->mailer->compose('contact/html') ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject) ->send();, (*6)


For further instructions refer to the [related section in the Yii Definitive Guide](http://www.yiiframework.com/doc-2.0/guide-tutorial-mailing.html) Also you can use SendCloud template Emails ``` php Yii::$app->mailer->compose('contact/html') ->setFrom('from@domain.com') ->setTo([email1, email2]) ->setSubject($form->subject) ->setTemplateName('revoke-name') ->setTemplateVars([ '%name%' => ['X1', 'X2'], '%money%'=> [12.5, 1.9] ]) ->send();

To send SMS message: php Yii::$app->sendSms->setTo(['13700000000', '13011111111']) ->setTemplate('1001') ->setVars(['code' => '000111']) ->send();, (*7)

For further instruction refer to the SendCloud SMS API doc, (*8)

The Versions

21/01 2018

dev-master

9999999-dev

Provides Yii2 component for SendCloud email service

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

21/01 2018

v0.2.0

0.2.0.0

Provides Yii2 component for SendCloud email service

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

13/01 2018

v0.1.0

0.1.0.0

Provides Yii2 component for SendCloud email service

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires