hybridinteractive/craft-contact-form-extensions 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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...

Icon

Latest Version Total Downloads

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

Screenshot

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.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require hybridinteractive/craft-contact-form-extensions
    
  3. 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.

Screenshot

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 hybridinteractive/craft-contact-form-extensions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 42
  • 点击次数: 16
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 42
  • Watchers: 7
  • Forks: 37
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-28