MailHog is a nice mail testing tool for developers.
Website: https://github.com/mailhog/MailHog
Download the latest release on your local machine
<?php | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\Core\Session\AccountInterface; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Drupal\Core\Access\AccessResult; | |
use Drupal\Core\Url; | |
/** |
<?php | |
// Insert new item on top of the list. | |
// Display file input first for better UI (https://lut.im/0AkZwIQOUa/dtzEPerqgp3hQ3hk.png) | |
// In a .module | |
/** |
<?php | |
namespace Drupal\yourmodule\Plugin\views\filter; | |
use Drupal\Core\Entity\Element\EntityAutocomplete; | |
use Drupal\Core\Entity\EntityStorageInterface; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\node\Entity\Node; | |
use Drupal\node\NodeStorageInterface; | |
use Drupal\views\ViewExecutable; |
<?php | |
/** | |
* ICS.php | |
* ======= | |
* Use this class to create an .ics file. | |
* | |
* Usage | |
* ----- | |
* Basic usage - generate ics file contents (see below for available properties): |
<?php | |
/** | |
* Implements hook_token_info_alter() | |
*/ | |
function MODULE_token_info_alter(&$data) { | |
// Modify description of node tokens for our site. | |
$data['tokens']['node-field_myfield']['foo'] = [ | |
'name' => "Foo", | |
'description' => "Process field_myfield value" |
MailHog is a nice mail testing tool for developers.
Website: https://github.com/mailhog/MailHog
Download the latest release on your local machine
Url::fromUri('mailto:[email protected]')
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specifiy | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
<?php | |
namespace Drupal\custom_commerce_recurring; | |
use Drupal\commerce_order\Entity\OrderInterface; | |
use Drupal\commerce_recurring\RecurringOrderManager as BaseRecurringOrderManager; | |
use Drupal\commerce_recurring\RecurringOrderManagerInterface; | |
use Drupal\Component\Datetime\TimeInterface; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; |
#!/bin/bash | |
# How to use this script? | |
# | |
# 1. create an empty module that depends on default_content or reuse an | |
# existing one. | |
# 2. use `drush dcer --folder=path/to/module/content ENTITY_TYPE ID` | |
# to add default content to your module. | |
# 3. once all your content is in your module, clean up the content folder | |
# to only keep the content you need (ie. remove users most of the time). |