Download the PHP package madebyraygun/constant-contact without Composer
On this page you can find all versions of the php package madebyraygun/constant-contact. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download madebyraygun/constant-contact
More information about madebyraygun/constant-contact
Files in madebyraygun/constant-contact
Package constant-contact
Short Description Basic Contact Contact integration for Craft CMS
License MIT
Informations about the package constant-contact
Constant Contact plugin for Craft CMS 3.x
Basic integration with Constant Contact API to allow you to add new contacts to your Constant Contact lists.
Requirements
This plugin requires Craft CMS 3.7.20 or later.
Installation
To install the plugin, 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 madebyraygun/constant-contact
- In the Control Panel, go to Settings → Plugins and click the “Install” button for Constant Contact.
Configuring Constant Contact
Signup for Constant Contact API access at Mashery. From there you can generate your API key and get an authentication token. You can also get your list ID by visiting the API tester and intiate a GET request against the /lists
endpoint.
Configure the plugin by creating a new config file named constant-contact.php in your config folder, and add the following the config parameters:
Example config file
Note: list should be a numerical ID.
Using Constant Contact
Create a new form in a front-end template, like so:
You can optionally override the default list by adding a hidden listid input
Example
Displaying flash messages
When a contact form is submitted, the plugin will set a notice or success flash message on the user session. You can display it in your template like this:
Ajax submitting
If the form is submitted with Ajax, the plugin will return a JSON object with the same keys as the template object described above.
Example: