Skip to content

Mailchimp API - Laravel Library (Worked on Mailchimp API v3)

Notifications You must be signed in to change notification settings

vickzkater/mailchimp-helper-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Mailchimp API Helper - Laravel Library (MailchimpHelper)

Mailchimp API Helper - Laravel Library (MailchimpHelper)

Mailchimp API Helper - Laravel Library (MailchimpHelper)

Worked on Mailchimp API v3

Packages Used (Outside of Laravel)

Feature

  • Get List
  • Check the status of a contact
  • Subscribe a user to your list with merge fields and double-opt-in confirmation disabled
  • View Tags
  • Add New Tag
  • Add a tag to a contact
  • View tags in a contact

How-to-Use

Set Mailchimp configurations in .env file

...
MC_KEY=xxx
MC_LIST_ID=xxx
MC_TAG_DEFAULT=xxx
...
  • MC_KEY = Mailchimp API key
  • MC_LIST_ID = Mailchimp List ID
  • MC_TAG_DEFAULT = Mailchimp Tag ID as default

Copy MailchimpHelper.php to your Laravel project - for sample copy then paste in app/Libraries

In your Controller file, please include the MailchimpHelper library

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

// USE LIBRARIES
use App\Libraries\MailchimpHelper;

class XxxController extends Controller
{
    ....

How to call the function in MailchimpHelper library

public function mailchimp_subscribe(Request $request)
{
    // SET THE PARAMETERS
    $email_address = $request->input('email');
    $result = MailchimpHelper::add_subscribe($email_address);

    dd($result);
}

For sample, please check DevController.php

Contributing

Thank you for considering contributing to the MailchimpHelper.

Bugs, Improvements & Security Vulnerabilities

If you discover a bug or security vulnerability within MailchimpHelper, please send an email to Vicky Budiman at vicky@kiniditech.com. All requests will be addressed promptly.

Issues

If you come across any issue/bug please report them here.

License

MailchimpHelper is open-sourced software built by KINIDI Tech and contributors and licensed under the MIT license.

Credits

Brought to you by

KINDI Tech

KINIDI Tech

Releases

No releases published

Packages

No packages published

Languages