Recent publications

Queue email

 

When sending email from your application, using queuing process can reduce the application response time and increase speed.

By sending the message to queue instead of sending directly at the end of server response, you may achieve better user experience. Once messages are in queue, you just need a scheduled cron task to initiate scheduled email sending.

How ?

Queuing is simple in Drupal 8

Let's imagine you have a module that currently send an email using mail plugin to multiple users:


foreach (User::loadMultiple($users) as $account) {
    \Drupal::service('plugin.manager.mail')->mail(
            'my_module,
            'my_key',
            $account->getEmail(),
            $account->getPreferredLangcode(),
            $params,
            $from->mail,
            TRUE
         );
}

 

To direct message to queue instead, you can replace with queue service:

Coil - new release

Web monetization service is a browser API which allow creation of (micro) payments between the reader (user agent) and the content provider (website).

This is one way of getting paid for valuable content.

Today Coil is providing web monetization service using Interledger protocol (ILP).

We have built a simple module to integrate coil monetization with Drupal website.

 

We are proposing a new beta version with enhanced possibilities to monetized your content:

  • New fields are added to "Articles" and "Basic page" for monetization;
  • Content type can be restricted to coil subscribers;
  • Subscription alert can be customized (text and color).

 

The following video will give you a preview of the new options available:

Custom Block in Drupal 8

In this article, we will see how we built custom blocks in EK management tools suite with a sample basic block in a module called 'mymodule' used for demo. It can be used to display multiple content, static or dynamic as in the example above.

Create the block script

First we will create a script that will display some content within a block. the script file will be called MyBlock.php and is placed in /mymodule/src/Plugin/Block/.

Install and use Swift Mailer in Drupal 8 (part 2 : implementation)

 

Swiftmailer is abandoned and will be replaced by Symfony Mailer : check our post about Symfony Mailer

 

In previous article we explained how we installed the Swift Mailer module and its dependencies.

In this second part, let's see how we configure and implement it to use in our modules to send formated HTML mail with attachment.

First you will need to have Mail system module installed already. There is no particular issue or difficulty here.

 

1) Configure Swift Mailer

 

In Swift Mailer configuration (/admin/config/swiftmailer/transport) , we select the following options:

Transport: