made-by-bramble/craft-ecards

1.0.0 2025-01-16 20:57 UTC

This package is auto-updated.

Last update: 2025-08-16 22:44:18 UTC


README

A powerful and flexible eCards plugin for Craft CMS that integrates with Craft Commerce to provide digital greeting card functionality for your e-commerce store.

Features

🎨 Design Management

  • Create and manage multiple eCard designs through an intuitive control panel
  • Upload custom images for each design
  • Use custom email templates for each design
  • Support for multiple designs per product

💌 eCard Management

  • Central management dashboard for all sent and scheduled eCards
  • View, resend, and delete eCards
  • Track sent and scheduled eCards
  • Search and filter capabilities

🛍️ Commerce Integration

  • Seamless integration with Craft Commerce
  • Automatic eCard processing after order completion
  • Custom field type for products for easy setup and management
  • Validates eCard information during checkout

⏰ Scheduling System

  • Schedule eCards for future delivery
  • Automated sending at specified dates and times
  • Queue-based processing for reliable delivery
  • Retry functionality for failed sends

📧 Email Features

  • Customizable email templates
  • Support for HTML email designs
  • Personalized messages
  • Responsive email layouts

🔧 Developer Features

  • Custom field type for flexible implementation
  • Template variables for frontend integration

Requirements

  • Craft CMS 5.5.0 or later
  • Craft Commerce 5.2.0 or later
  • PHP 8.2 or later

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project's Control Panel and search for "eCards by Bramble". Then click "Install".

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require made-by-bramble/craft-ecards

# tell Craft to install the plugin
./craft plugin/install ecards-by-bramble

Configuration

After installation, you can configure the plugin through the Control Panel under Settings → eCards by Bramble.

Usage

Creating eCard Designs

  1. Navigate to eCards by Bramble → Designs in the Control Panel
  2. Click "New Design"
  3. Upload your design image
  4. Configure the email template if required. If left blank, the default email template will be used.
  5. Save your design

Adding eCards to Products

  1. Edit your product type
  2. Add the "Ecard Multi Design" field type and give it a suitable handle
  3. Assign designs to your products

Updating Your Product Page

The plugin requires that you specify several options when adding your products to the cart.

  • designId - The element ID of the design you want to use (required)
  • senderName - The name of the sender (required)
  • recipientName - The name of the recipient (required)
  • recipientEmail - The email address of the recipient (required)
  • message - The message to include in the eCard (required)
  • sendAt - The date and time to send the eCard (optional)

For convenience, a function has been added to the EcardMultiDesignField class that will generate the necessary HTML for the designId for you. Ensure you replace the field handle with the handle you gave your field.

{% set product = craft.products.one() %}
{% set ecardField = craft.app.fields.getFieldByHandle('yourFieldHandleHere') %}
{{ ecardField.getFrontEndInput(product.yourFieldHandleHere, product)|raw }}

Alternatively, you can build your own HTML. As long as you pass through all of the required options, the plugin will handle the rest.

The sendAt field is a date picker field. If you want to send the eCard immediately, you can set the date to today or leave it blank.

Validating eCard Information

The plugin will automatically validate the eCard information when the product is added to the cart. If the information is not valid, an array of errors will be added to the order and the add to cart will fail. You can then use the craft.commerce.carts.cart.errors function to access and display the errors to the user.

Managing eCards

  1. Navigate to eCards by Bramble → Manager
  2. View all sent and scheduled eCards
  3. Search and filter eCards
  4. Resend or delete eCards as needed

Order Processing

The plugin automatically processes eCards when an order is completed:

  • Validates eCard information
  • Schedules delivery based on specified date
  • Sends confirmation to sender
  • Delivers eCard to recipient

Scheduled eCards

The plugin can automatically send scheduled eCards. To enable this behaviour you must create a cron job that calls the index method of the CronController class. This is an example of how you can do this in a Linux environment:

* * * * * curl -s https://your-site.test/ecards-by-bramble/cron > /dev/null 2>&1

This will run the cron job every minute. You can adjust the frequency as needed.

Support

For support, please contact hello@madebybramble.co.uk

License

This plugin requires a commercial license which can be purchased through the Craft Plugin Store.