Skip to content

Instantly share code, notes, and snippets.

View pontikis's full-sized avatar

Christos Pontikis pontikis

View GitHub Profile
@pontikis
pontikis / mailgun_email_validation.php
Last active August 20, 2018 17:03
Email validation with Mailgun and php
<?php
/**
* https://documentation.mailgun.com/en/latest/user_manual.html#email-validation.
*/
use Mailgun\Mailgun;
$mgClient = new Mailgun('YOUR_PUBLIC_API_KEY');
$responce = $mgClient->get('address/validate',
[
@pontikis
pontikis / mailgun_php_api_send.php
Last active August 20, 2018 16:54
Send mail with PHP Mailgun API
<?php
$mg = Mailgun::create('YOUR_PRIVATE_API_KEY');
$mg_domain = 'mail.company.com';
$mg_response = $mg->messages()->send($mg_domain,
[
'subject' => 'Subject here',
'from' => 'Company Support <support@company.com>',
'to' => 'John Doe <john.doe@gmail.com>',
@pontikis
pontikis / .gitignore
Created July 26, 2011 14:39
tinymce in a nutshell
# /.idea
/.idea/*
@pontikis
pontikis / .gitingore
Created July 21, 2011 16:28
jsTree in a nutshell
# /.idea
/.idea/*
@pontikis
pontikis / tree_to_flat_id_list.php
Created July 3, 2011 12:37
Create a flat list of id from tree (respecting tree display order)
<?php
/**
* Create a flat list of id (respecting tree display order).
* Assumes that $table is keeping tree structure using "id", "parent_id", "display_order" fields
* @param string $table name of the table keeping tree data
* @param integer $start_node_id the id of the start node
* @param boolean $include_start_node include (or not) the id of the start node in returning result
* @param string $f_id name of "id" field
* @param string $f_parent_id name of "parent_id" field