const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/clientsiwanta/public_html/mautic/ | |
find . -type d -exec sudo chmod 755 {} \; | |
find . -type f -exec sudo chmod 644 {} \; | |
sudo chmod -R g+w app/cache/ | |
sudo chmod -R g+w app/logs/ | |
sudo chmod -R g+w app/config/ | |
sudo chmod -R g+w media/files/ | |
sudo chmod -R g+w media/images/ | |
sudo chmod -R g+w translations/ | |
sudo chown -R www-data:www-data . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Mautic Form Test</title> | |
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.mauticform_wrapper { | |
max-width: 600px; | |
margin: 10px auto; | |
} | |
.mauticform-innerform {} | |
.mauticform-post-success {} | |
.mauticform-name { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.onreadystatechange = function () { | |
if (document.readyState == 'interactive') { | |
if (document.forms.length !== 0 && location.search) { | |
var query = location.search.substr(1); | |
query.split('&').forEach(function (part) { | |
if (part.indexOf('=') !== -1) { | |
var item = part.split('='); | |
var key = item[0]; | |
var value = decodeURIComponent(item[1]); | |
var inputs = document.getElementsByName('mauticform[' + key + ']'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="contact-form" action="//formspree.io/[email protected]" method="post"> | |
<input type="text" name="Name" placeholder="Name" required> | |
<input type="email" name="Email" placeholder="Email" required> | |
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea> | |
<!-- CONFIG --> | |
<input class="is-hidden" type="text" name="_gotcha"> | |
<input type="hidden" name="_subject" value="Subject"> | |
<input type="hidden" name="_cc" value="[email protected]"> | |
<!-- /CONFIG --> | |
<input class="submit" type="submit" value="Send"> |
Mautic has API to interact with other systems. There is PHP API library for faster integration to PHP projects.
API library isn't at Packagist in time of writing this article. Good chance is the library is at Packagist in time of reading, so install it from there and skip this.
Install from GitHub repo. So to use the library as Composer package from GitHub repo your composer.json should contain:
...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p.4columns { | |
-webkit-column-count: 4; /* Chrome, Safari, Opera */ | |
-moz-column-count: 4; /* Firefox */ | |
column-count: 4; | |
-webkit-column-gap: 20px; /* Chrome, Safari, Opera */ | |
-moz-column-gap: 20px; /* Firefox */ | |
column-gap: 20px; | |
column-rule-color: #ccc; /* Optional */ | |
column-rule-style:solid; /* Optional */ | |
column-rule-width: 1px; /* Optional */ |
NewerOlder