=== FormZend ===
Contributors: formzend
Tags: email templates, gravity forms, contact form 7, wpforms, gutenberg
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Design reusable block-based email templates for WordPress, Gravity Forms, Contact Form 7, Ninja Forms, WPForms, and Fluent Forms.

== Description ==

FormZend brings email design into the WordPress block editor. Create a template once, style it with familiar blocks, and use it for WordPress system emails or notifications sent by supported form plugins.

FormZend Lite includes the complete template management experience for core WordPress emails. An active FormZend license unlocks supported form-plugin integrations and automatic software updates.

= Features =

* Create reusable email templates in the native WordPress block editor.
* Apply templates to supported core WordPress emails, including password resets, new-user notifications, account-change emails, and admin email change confirmations.
* Connect templates to Gravity Forms notifications.
* Assign templates independently to Contact Form 7 Mail and Mail (2).
* Connect templates to Ninja Forms email actions.
* Link templates to WPForms notifications, including all saved notifications in WPForms Pro.
* Connect templates to Fluent Forms notifications.
* Insert form-specific merge tags, mail tags, Smart Tags, and SmartCodes while editing.
* Preview templates with representative form data or recent Gravity Forms entries.
* Send test emails from the template editor.
* Place the original notification content anywhere with the Email Message block.
* Show or hide Group blocks using conditional rules based on submitted field values.
* Add best-effort background images to Group blocks with editor compatibility warnings and solid-colour fallbacks.
* Add and manage social links with email-friendly styling.
* Control which WordPress user roles can access FormZend templates.
* Optionally create draft templates with supported WordPress AI integrations.

= Email-friendly blocks =

FormZend provides a focused set of blocks suited to email layouts, including Paragraph, Heading, Image, Site Logo, Table, Buttons, Spacer, Separator, Columns, Group, List, Custom HTML, reusable blocks, Social Links, and Email Message.

= Supported integrations =

* WordPress core emails
* Gravity Forms
* Contact Form 7
* Ninja Forms
* WPForms Lite and Pro
* Fluent Forms

Third-party form integrations require an active FormZend license. If a license expires, saved connections remain in place but no longer affect form emails until the license is reactivated. Core WordPress email templates remain available in FormZend Lite.

== Installation ==

1. Upload the FormZend plugin folder to `/wp-content/plugins/`, or install the plugin ZIP from Plugins > Add New > Upload Plugin.
2. Activate FormZend from the Plugins screen.
3. Open FormZend in the WordPress admin menu and create your first email template.
4. For a core WordPress email, select WordPress Emails as the template source and choose the email types that should use the template.
5. To use a supported form integration, install and activate the form plugin, then activate your FormZend license under FormZend > License.
6. Publish the template and connect it to the relevant email or notification.

== Frequently Asked Questions ==

= Can I use FormZend without a license? =

Yes. FormZend Lite lets you create, edit, clone, publish, trash, and delete templates for supported core WordPress emails. A license is required for third-party form integrations and automatic updates.

= Which form plugins does FormZend support? =

FormZend supports Gravity Forms, Contact Form 7, Ninja Forms, WPForms, and Fluent Forms.

= What happens to my templates if my license expires? =

Your templates and saved form connections remain stored. Form integrations stop applying those templates until the license is reactivated. Core WordPress email templates continue to work in FormZend Lite.

= Can I use form merge tags in a template? =

Yes. When a template is connected to a supported form, FormZend makes that provider's merge tags available in the editor and resolves them when the email is sent.

= How do I include the original notification message? =

Add the Email Message block wherever the provider's original email content should appear in your template.

= Can I test a template before publishing it? =

Yes. FormZend includes preview and test-send tools in the template editor. Available preview data depends on the selected email source.

= Can I use background images? =

Yes. Group blocks support background images, including cover or contain sizing, image position, and repeating backgrounds. Because some email clients, including classic Outlook for Windows, do not display background images, always set a similar background colour on the Group block. FormZend shows this compatibility warning in the editor; it is not included in sent emails.

= Does FormZend send emails itself? =

FormZend designs and renders the email content. Delivery continues through WordPress and the selected form plugin, so it works with your existing mail configuration or SMTP plugin.

= Can another plugin attach a PDF to a FormZend Gravity Forms email? =

Yes. FormZend preserves attachments added through Gravity Forms' native `gform_notification` filter. Integrations that should run only for notifications rendered by FormZend can use `formzend_gravity_forms_notification_attachments`:

```
add_filter( 'formzend_gravity_forms_notification_attachments', function( $attachments, $notification, $form, $entry, $template_id ) {
	$pdf_path = my_plugin_get_pdf_path_for_entry( $entry );

	if ( $pdf_path && is_readable( $pdf_path ) ) {
		$attachments[] = $pdf_path;
	}

	return $attachments;
}, 10, 5 );
```

Attachment values must be absolute, readable file paths. The filter also receives the complete Gravity Forms notification, form and entry arrays, plus the FormZend template ID, so an integration can limit attachments to particular forms or notifications.

== Changelog ==

= 1.0.3 =

* Added best-effort background image support for Group blocks, including cover and contain sizing, positioning, and repeating backgrounds.
* Added email-friendly inline styles and legacy table attributes with solid-colour fallbacks for broader client compatibility.
* Added editor-only compatibility warnings for background images and Groups without fallback colours.

= 1.0.2 =

* Restricted FormZend email templates to the WordPress admin area by disabling public single-template URLs and unauthenticated REST API access.
* Added a one-time rewrite-rule refresh to remove legacy front-end template routes after upgrading.

= 1.0.1 =

* Added a public Gravity Forms attachment filter so third-party plugins can append PDFs and other files specifically to notifications rendered by FormZend.
* Documented compatibility with attachments added through Gravity Forms' native notification filter.

= 1.0.0 =

* Initial public release.
* Added reusable block-editor email templates.
* Added WordPress core email template support.
* Added integrations for Gravity Forms, Contact Form 7, Ninja Forms, WPForms, and Fluent Forms.
* Added provider-aware merge tags, previews, test sends, and conditional content.
* Added FormZend Lite mode, license management, and licensed software updates.
* Added optional WordPress AI-assisted draft template creation.

== Upgrade Notice ==

= 1.0.3 =

Adds background image support for Group blocks with solid-colour fallbacks and editor-only compatibility warnings.

= 1.0.2 =

Keeps FormZend email templates private to the WordPress admin area and removes legacy front-end template routes.

= 1.0.1 =

Adds a public integration hook for attaching PDFs and other files to FormZend-rendered Gravity Forms notifications.

= 1.0.0 =

Initial public release of FormZend.
