Skip to content

Commit

Permalink
Bugfix. overtrue#35
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jul 11, 2017
1 parent e1ed84a commit c010233
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ $easySms->send(13188888888, $message);
'sendcloud' => [
'sms_user' => '',
'sms_key' => '',
'timestamp' => false, // 是否启用时间戳
],
```
### [百度云](https://cloud.baidu.com/)
Expand Down
5 changes: 4 additions & 1 deletion src/Gateways/SendcloudGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ public function send($to, MessageInterface $message, Config $config)
'templateId' => $message->getTemplate(),
'phone' => is_array($to) ? implode(',', $to) : $to,
'vars' => $this->formatTemplateVars($message->getData()),
'timestamp' => time(),
];

if ($config->get('timestamp', false)) {
$params['timestamp'] = time() * 1000;
}

$params['signature'] = $this->sign($params, $config->get('sms_key'));

$result = $this->post(sprintf(self::ENDPOINT_TEMPLATE, 'send'), $params);
Expand Down

0 comments on commit c010233

Please sign in to comment.