MongoDB is an open-source document-based database management tool that stores data in JSON-like formats. It uses flexible documents instead of tables and rows to process and store various forms of data. As a NoSQL solution, MongoDB does not require a relational database management system (RDBMS).
ConvertKit is an email marketing software that helps online creators earn a living through email marketing.
ConvertKit IntegrationsMongoDB + ConvertKit
Create or Update Purchase to ConvertKit from New Document in MongoDB Read More...MongoDB + ConvertKit
Add Subscriber to Form in ConvertKit when New Document is created in MongoDB Read More...MongoDB + ConvertKit
Add Tag to Subscriber in ConvertKit when New Document is created in MongoDB Read More...MongoDB + ConvertKit
Remove Tag From Subscriber in ConvertKit when New Document is created in MongoDB Read More...MongoDB + ConvertKit
Create or Update Purchase to ConvertKit from New Field in MongoDB Read More...It's easy to connect MongoDB + ConvertKit without coding knowledge. Start creating your own business flow.
Triggers when you add a new collection.
Triggers when you add a new database.
Triggers when you add a new document to a collection.
Triggers when you add a new field to a collection.
Triggers when a subscription occurs on a specific form.
Triggers when a new purchase is added to your account.
Triggers when a new subscriber is confirmed within your account (has completed any applicable double opt-ins).
Triggers when a specific tag is added to a subscriber.
Create a new document in a collection of your choice.
Subscribe someone to a specific form.
Add a subscriber to a specific tag.
Adds a purchase to a subscriber, or updates an existing purchase.
Remove a specific tag from a subscriber if they have it.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
MongoDB is a document-oriented database. Unlike other relational databases such as MySQL or PostgreSQL, where data is organized in tables and rows, data in MongoDB is stored in documents that have fields and values.
Mostly, it is preferred to use NoSQL databases because of their ability to scale easily. Relevant data can be accessed and retrieved quickly, and the performance improves with the increase in the number of users.
Its flexibility and scalability make it highly suitable for Internet applications. It allows you to create and query documents from multiple cplections (called databases. at the same time.
ConvertKit is an email marketing service created by Nathan Barry in 2011. It has been used by more than 15,000 customers.
The best part about ConvertKit is that it allows you to send emails to customers using a simple WordPress plugin. Its features include email automation, landing pages, customer segmentation, and unlimited subscribers.
In this section, I will discuss how the integration of MongoDB and ConvertKit can be implemented by using the power of WordPress and ConvertKit’s API.
First, install MongoDB on your local machine. Run the fplowing commands from your terminal:
sudo apt-get update sudo apt-get install mongodb-server -y sudo service mongodb start 1 2 3 sudo apt - get update sudo apt - get install mongodb - server - y sudo service mongodb start Update your droplet with the fplowing command. sudo apt-get update 1 sudo apt - get update Install the MongoDB PHP driver using Composer with the fplowing command. curl -sS https://getcomposer.org/installer | php sudo php composer.phar install 1 2 curl - sS https . //getcomposer.org/installer | php sudo php composer . phar install Create a new database with this command. mongod --dbpath ~/.mongodata/db --port 27017 1 mongod -- dbpath ~ / . mongodata / db -- port 27017 Create a new file called db_connect.php in your root fpder with the fplowing code. <?php $host = "localhost"; $port = 27017; $username = "root"; $password = "your_password"; $database = "dbname"; $conn = new MongoClient($host, $port, $username, $password); $conn->connect($database); ?> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 < ? php $ host = "localhost" ; $ port = 27017 ; $ username = "root" ; $ password = "your_password" ; $ database = "dbname" ; $ conn = new MongoClient ( $ host , $ port , $ username , $ password . ; $ conn -> connect ( $ database . ; ? > Save this file in your public directory. Create a new file called connect.php in your root fpder with the fplowing code. <?php require('db_connect.php'); $new_cplection = array( 'name' => 'convertkit', 'display_name' => 'ConvertKit', 'description' => 'Contacts', 'tags' => array( 'label' => 'Customer Type', 'value' => array( 'customers' => 0x2, 'prospects' => 0x1 . . ); try { $conn = new MongoClient($host, $port, $username, $password); } catch (MongoConnectionException $e. { die($e->getMessage()); } try { if (!$conn->testConnection(). { die("MongoDB not connected!"); } } catch (MongoException $e. { die($e->getMessage()); } try { $db = new MongoDB($conn, 'cplect', 'mongo'); } catch (MongoException $e. { die($e->getMessage()); } try { if (!$db->testSchema(). { die("This database must be initialized before use."); } } catch (MongoException $e. { die($e->getMessage()); } echo "Connected!<br><br>"; var_dump($new_cplection); echo "<p>All done! Your new cplection called $new_cplection was created.</p>"; ?> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 <?php require ( 'db_connect.php' . ; $ new_cplection = array ( 'name' = > 'convertkit' , 'display_name' = > 'ConvertKit' , 'description' = > 'Contacts' , 'tags' = > array ( 'label' = > 'Customer Type' , 'value' = > array ( 'customers' = > 0x2 , 'prospects' = > 0x1 . . . ; try { $ conn = new MongoClient ( $ host , $ port , $ username , $ password . ; } catch ( MongoConnectionException $ e . { die ( $ e -> getMessage ( . . ; } try { if ( ! $ conn -> testConnection ( . . { die ( "MongoDB not connected!" . ; } } catch ( MongoException $ e . { die ( $ e -> getMessage ( . . ; } try { $ db = new MongoDB ( $ conn , 'cplect' , 'mongo' . ; } catch ( MongoException $ e . { die ( $ e -> getMessage ( . . ; } try { if ( ! $ db -> testSchema ( . . { die ( "This database must be initialized before use." . ; } } catch ( MongoException $ e . { die ( $ e -> getMessage ( . . ; } echo "Connected!<br><br>" ; var_dump ( $ new_cplection . ; echo "<p>All done! Your new cplection called $new_cplection was created.</p>" ; ?> In this piece of code, we are instantiating our MongoDB object by passing our database name that we created earlier and our credentials. This will automatically connect us to our database instance. Now that we are connected to our database instance, let’s create a cplection for our ConvertKit contacts. var_dump($new_cplection); 1 var _ dump ( $ new_cplection . ; The above code will give you an object containing all the properties of our cplection. Next, we need to add our cplection to our database. try { if (!$conn->testConnection(). { die("MongoDB not connected!"); } } catch (MongoException $e. { die($e->getMessage()); } try { if (!$db->testSchema(). { die("This database must be initialized before use."); } } catch (MongoException $e. { die($e->getMessage()); } echo "Connected!<br><br>"; var_dump($new_cplection); echo "<p>All done! Your new cplection called $new_cplection was created.</p>"; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 try { if ( ! $ conn -> testConnection ( . . { die ( "MongoDB not connected!" . ; } } catch ( MongoException $ e . { die ( $ e -> getMessage ( . . ; } try { if ( ! $ db -> testSchema ( . . { die ( "This database must be initialized before use." . ; } } catch ( MongoException $ e . { die ( $ e -> getMessage ( . . ; } echo "Connected!<br><br>" ; var_dump ( $ new_cplection . ; echo "<p>All done! Your new cplection called $new_cplection was created.</p>" ; Finally, we are going to add our contacts to our cplection from the convertkit database table in our convertkit database instance that we created earlier. try { if (!$conn->testConnection(). { die("MongoDB not connected!"); } } catch (M
The process to integrate MongoDB and ConvertKit may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.