hybridinteractive/craft-contact-form-extensions
Composer 安装命令:
composer require hybridinteractive/craft-contact-form-extensions
包简介
Adds extensions to the Craft CMS contact form plugin.
README 文档
README
Back in Action
Fellow Crafters,
We are currently working on a new version of Contact Form Extensions. Our goal with this upgrade is to be a standalone plugin that's not dependent on Craft's Contact Form. We have long supported several free plugins and love supporting Open Source. Sometimes it makes more fiscal sense to charge a nominal fee in order to warrant spending the type of time maintaining such a popular plugin can command at times.
Thank you for your patience and understanding.
Stay tuned for more details...
Adds extensions to the Craft CMS contact form plugin.
- Save submissions to the database and view them in the Control Panel
- Add a confirmation email that is sent to the submitting email
- Overwrite the default e-mail template
- Add an invisible reCAPTCHA
Support Open Source
This plugin is licensed under a MIT license, which means that it's completely free open source software, and you can use it for whatever and however you wish.
Requirements
This plugin requires Craft CMS 4 and the Contact Form plugin.
Installation
Install this plugin through the Plugin Store or follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project -
Then tell Composer to load the plugin:
composer require hybridinteractive/craft-contact-form-extensions -
In the Control Panel, go to Settings → Plugins and click the “Install” button for Craft Contact Form Extensions.
Overwriting the email templates
When you overwrite the email templates, your twig view will receive a submission variable which contains all the information that a default Contact Form submission contains:
- fromName
- fromEmail
- subject
- message
- attachment
Overriding the form name
When saving submissions to the database the default form name will be "Contact". If you add a message[formName] hidden field you can override the form name. This can also used to create multiple form indexes in the Control Panel.
<input type="hidden" name="message[formName]" value="myFormName">
Overriding the confirmation template
When sending confirmation option is enabled and custom templates per form are needed, override the template with a hidden field. The template needs to be placed under templates\_emails folder. Add a hash for safety. The same data is passed as in the default overridden template.
<input type="hidden" name="message[confirmationTemplate]" value="{{ 'contact'|hash }}">
Overriding the confirmation subject
When sending confirmation option is enabled and custom subjects per form are needed, override the subject with a hidden field. Add a hash for safety.
<input type="hidden" name="message[confirmationSubject]" value="{{ 'confirmationSubject'|hash }}">
Overriding the notification template
When sending notification option is enabled and custom templates per form are needed, override the template with a hidden field. The template needs to be placed under templates\_emails folder. Add a hash for safety. The same data is passed as in the default overridden template.
<input type="hidden" name="message[notificationTemplate]" value="{{ 'contact'|hash }}">
Overriding where the message is sent
<input type="hidden" name="message[toEmail]" value="{{ 'hello@rias.be'|hash }}">
Please note: Craft 5's version of this plugin does not support Recaptcha, we apologize for any inconvenience.
Disable recaptcha on a per form basis
<input type="hidden" name="message[disableRecaptcha]" value="true">
Disable saving to database on a per form basis
<input type="hidden" name="message[disableSaveSubmission]" value="true">
Disable confirmation email on a per form basis
<input type="hidden" name="message[disableConfirmation]" value="true">
Adding invisible reCAPTCHA
Before you set your config, remember to choose invisible reCAPTCHA while applying for keys.
Enable reCAPTCHA in the Contact Form Extensions settings and fill in your siteKey and secretKey.
Then use the following code in your forms inside of the <form> element:
{{ craft.contactFormExtensions.recaptcha | raw }}
ReCaptcha V3
To use ReCaptcha V3, choose the V3 option in the settings, make sure to enter a correct siteKey and secretKey and enter a threshold. Learn more about ReCaptcha V3
Then include the following code in your forms inside of the <form> element, for example for the homepage action (actions help separate out reCaptcha submissions within the reCaptcha console):
{{ craft.contactFormExtensions.recaptcha('homepage') | raw }}
Display form submissions in your template files
{% for submission in craft.contactFormExtensions.submissions %}
{{ submission.dateCreated|date('d-m-Y H:i') }} - {{ submission.fromEmail }} - {{ submission.fromName }}
{% endfor %}
Brought to you by Hybrid Interactive
hybridinteractive/craft-contact-form-extensions 适用场景与选型建议
hybridinteractive/craft-contact-form-extensions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 99k 次下载、GitHub Stars 达 42, 最近一次更新时间为 2020 年 05 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「Craft」 「craftcms」 「craft-plugin」 「craft contact form extensions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hybridinteractive/craft-contact-form-extensions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hybridinteractive/craft-contact-form-extensions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hybridinteractive/craft-contact-form-extensions 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Expand, collapse, change the status of, or delete multiple blocks in a Matrix field simultaneously.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Integrate with Snipcart.
Restrict user registration by domain in Craft CMS, allows you to limit who can register for your site based on their email address.
统计信息
- 总下载量: 99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 42
- 点击次数: 16
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-28

