This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Records extends \yii\db\ActiveRecord | |
| { | |
| const EVENT_SEND_EMAIL_UPDATE = 'send-email-to-users'; | |
| public function init() { | |
| $this->on(self::EVENT_SEND_EMAIL_UPDATE, [$this, 'sendMail']); | |
| //use this if you want to add custom data to your events |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function actionBulk() { | |
| $model = new Records(); | |
| //import excel sheet with 5k records | |
| if ($model->customImport()) { | |
| //trigger the send email event | |
| $model->trigger(Records::EVENT_SEND_EMAIL_UPDATE); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| customer: { | |
| "firstname":"firstname", | |
| "lastname":"lastname", | |
| "email":"email", | |
| "phone":"phone", | |
| }, | |
| seller_id:17, | |
| delivery_type:"sendy default" | |
| delivery_cost: 34.90, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function actionPay() { | |
| $tillNumber = 174379; | |
| $storeNumber = 174379; | |
| $customerPhoneNumber = 2547xxxx; | |
| $timeStamp = date("Ymdhis"); | |
| $passKey = "bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919"; | |
| $password = base64_encode($storeNumber . $passKey . $timeStamp); | |
| // $token = $this->getToken(); | |
| $token ="GGpPaGYBCs3VLl7W2Bl0KzQ3h5MP"; |
OlderNewer