mangoweb-sylius / sylius-smsmanager-plugin
Sylius的短信管理插件
v0.2.0
2019-01-29 09:43 UTC
Requires
- php: ^7.1
- ext-curl: *
- sylius/sylius: ^1.2.5
- symfony/symfony: ^4.1
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/context-service-extension: ^1.2
- friends-of-behat/cross-container-extension: ^1.1
- friends-of-behat/service-container-extension: ^1.0
- friends-of-behat/symfony-extension: ^1.2.1
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpstan/phpstan-doctrine: ^0.10
- phpstan/phpstan-shim: ^0.10
- phpstan/phpstan-symfony: ^0.10
- phpstan/phpstan-webmozart-assert: ^0.10
- phpunit/phpunit: ^6.5
- se/selenium-server-standalone: ^3.12
- sylius-labs/coding-standard: ^2.0
This package is auto-updated.
Last update: 2024-09-13 21:42:55 UTC
README
短信管理插件
功能
- 使用 https://smsmanager.cz 账户向客户发送短信
- 通过短信通知客户包裹已发送
- 为每种运输方式和语言自定义文本
- 使用变量来自定义文本
安装
- 运行
$ composer require mangoweb-sylius/sylius-smsmanager-plugin
. - 在您的Kernel中注册
\MangoSylius\SmsManagerPlugin\MangoSyliusSmsManagerPlugin
. - 在config.yml中导入
@MangoSyliusSmsManagerPlugin/Resources/config/resources.yml
. - 您的实体
Channel
必须实现\MangoSylius\SmsManagerPlugin\Model\SmsManagerChannelInterface
. 您可以使用TraitMangoSylius\SmsManagerPlugin\Model\SmsManagerChannelTrait
. - 您的实体
ShippingMethodTranslation
必须实现\MangoSylius\SmsManagerPlugin\Model\SmsManagerShippingMethodInterface
. 您可以使用TraitMangoSylius\SmsManagerPlugin\Model\SmsManagerShippingMethodTrait
. - 在
@SyliusAdmin/Channel/_form.html.twig
中包含模板@MangoSyliusSmsManagerPlugin/channelSmsSegmentForm.html.twig
. - 在
@SyliusAdmin/ShippingMethod/_form.html.twig
中包含模板@MangoSyliusSmsManagerPlugin/shippingMethodSmsForm.html.twig
. 想要使用自己的实体,请参阅 Sylius文档 - 自定义模型
使用方法
首先在渠道设置中输入短信管理凭据和其他参数,然后为每种运输方式输入短信文本。如果文本为空,则不会发送短信。
您可以在文本中使用以下变量
{{ orderNumber }}
{{ trackingNumber }}
{{ address.fullName }}
{{ address.company }}
{{ address.street }}
{{ address.postCode }}
{{ address.city }}
{{ address.provinceCode }}
{{ address.provinceName }}
{{ address.countryCode }}
开发
使用方法
- 从 .env.dist 创建到 .env 的符号链接或创建自己的 .env 文件
- 在
/src
中开发您的插件 - 查看
bin/
以获取有用的命令
测试
修改后,您必须确保测试仍然通过。
- 易于编码标准
bin/ecs.sh
- PHPStan
bin/phpstan.sh
许可证
此库采用MIT许可证。
致谢
由 manGoweb 开发。