groovy/src

Groovy 邮件模板

安装: 549

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

类型:yii2-extension

1.5 2019-06-06 08:50 UTC

This package is auto-updated.

Last update: 2024-09-11 12:36:00 UTC


README

Groovy 邮件模板

安装 ---- V1.4

安装此扩展的首选方式是通过 composer

运行以下命令之一:

php composer.phar require --prefer-dist groovy/src "dev-master"

或将以下内容添加到您的 composer.json 文件的 require 部分中:

"groovy/src": "dev-master"

先进行迁移

php yii migrate --migrationPath=vendor/groovy/src/migrations

添加模块

'email' => [
    'class' => 'vendor\groovy\src\email\Module',
],

添加组件

'emailtemplate' => [
    'class' => 'vendor\groovy\src\email\components\EmailsTemplate',
    'allowDelete'=>false,
    'allowInsert'=>true,
    'dummycontent'=> dirname(dirname(__DIR__))."/frontend/web/emailtemplate/dummy.html",
    'icons'=>["update"=>"glyphicon glyphicon-pencil","view"=>"glyphicon glyphicon-eye-open","delete"=>"glyphicon glyphicon-trash"],
    'breadcrumbs'=> dirname(dirname(__DIR__))."/frontend/web/breadcrumbs/breadcrumbs.php",
],

使用方法

// Need Email HTML dynamic
$string_array = array(
    '{{Password}}'=>$password,
);
$html = Yii::$app->emailtemplate->replace_string_email($string_array ,"welcome_email"); // $string_array = Array Of String welcome_email = Email Slug

// Need Email HTML Subject
$subject_string_array = array(
     "{{app_name}}"=>Yii::$app->name
);
$subject = Yii::$app->emailtemplate->replace_string_email($subject_string_array ,"welcome_email","subject");// $string_array = Array Of String welcome_mail = Email Slug and subject