studioespresso/craft-buttondown 问题修复 & 功能扩展

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

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

studioespresso/craft-buttondown

最新稳定版本:1.0.0

Composer 安装命令:

composer require studioespresso/craft-buttondown

包简介

Buttondown integration

README 文档

README

This plugin allow you to collect email addresses from your website and send them to your Buttondown newsletter.

Note that the plugin is not affiliated with Buttondown in any way - I personally use their service and wanted to create a plugin to make it easier to integrate with Craft CMS.

Screenshot

Requirements

This plugin requires Craft CMS 5.6.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:
# go to the project directory
cd /path/to/my-craft-project.dev

# tell Composer to install the plugin
composer require studioespresso/craft-buttondown

# tell Craft to install the plugin
./craft install/plugin buttondown

Usage

The plugins needs an API key to connect to Buttondown. You can find your API key in your Buttondown account settings.

Basic subscriber form

In the simplest form, you only need an input called email, you can post that to the buttondown/subscriber controller:

<form method="post">
    {{ csrfInput() }}
    {{ actionInput('buttondown/subscriber') }}
    {{ redirectInput('thanks-for-subscribing') }}
    
    <label for="email-address">{{ "Email address"|t }}</label>
    <input id="email-address" name="email" type="email" autocomplete="email" required>
                           
    <button type="submit">{{ "Subscribe"|t }}</button>
</form>

Fields & tags

Buttondown makes it very easy to add custom fields and tags to subscribers, simply add them as fields or tags to the form like the example below:

<form method="post">
    {{ csrfInput() }}
    {{ actionInput('buttondown/subscriber') }}
    {{ redirectInput('thanks-for-subscribing') }}
    
    {# Add custom fields #}
    <label for="firstName" class="sr-only">{{ "First Name"|t }}</label>
    <input id="firstName" name="fields[firstName]" type="text" autocomplete="firstName">
    
    <label for="email-address">{{ "Email address"|t }}</label>
    <input id="email-address" name="email" type="email" autocomplete="email" required>
            
    {# Add tags, hidden or not #}
    <input type="hidden" name="tags[]" value="{{ siteName }}">               
    <button type="submit">{{ "Subscribe"|t }}</button>
</form>

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2025-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固