Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 49 min 51 sec ago

Arthur Foelsche: Accessibility Linting

Thu, 29/10/2015 - 16:00

First, let me say that I am not an expert in web accessibility. Unfortunately I think most people who are web developers aren't. Worse, evaluating development work to understand how people interact with it is not only hard, it is often relegated to a "508 checklist" rather than being a core piece of how website and application development happens. Further, the tools that help evaluate a site for accessibility concerns often only catch the more glaring concerns, still requiring evaluation by people. 

...human inspection is necessary when it comes to semantics, for instance to assess if the page title properly describes the page, if a particular element has either not been marked up at all or with a too generic element, or if elements which belong logically together can be grouped inside a proper element.

The report shows once more that human inspection is crucial to achieve a high degree of web accessibility, and that a dedicated effort must be made to develop a more modern generation of checkers suitable for the latest standards and recommendations, and tailored for the needs of today's testers, developers, and site owners.

-- Efficient Web Accessibility Testing

And that's the reality- people are still a fundamental part of the process. However, the tools that we do have now can provide a helpful first pass in evaluating our work. We have an opportunity to bring some accessibility questions to the fore during the development process.

My interest in linting is exactly this- that it is an easy way for teams integrate accessibility evaluation throughout the entire lifecycle of a project. By making it part of the pull request process these tools- as imperfect as they maybe- can catch some concerns early which can alleviate pressure if significant alterations are needed. Discovering that an ajax widget poses accessibility challenges is much easier to deal with early in the project rather than in a quality assurance sprint at the end. When accessibility problems make code unmergeable then teams can take responsibility for something they may have not realized until very late in the process. Scheduling regular time for assessment by people is of course still needed but the hope is that those reviews will be much more effective since many obvious concerns have already been addressed.


The results of a linting test against google.com. Accessibility concerns crop up everywhere.

So how can it be brought into to a continuous integration workflow? For some first pass testing, I have used access_lint which relies on Google's Accessibility Developer Tools to provide testing on CircleCi. Here's an example project which shows how implement linting as a test. It's basically three lines of code, two of which don't really count. Note that I'm using a specific branch of access_lint which handles the return status from the tests for CircleCi to evaluate. You can see the test result here.

The reality is that it's simple to integrate rudimentary tests for accessibility concerns. It does not absolve a team from doing a full audits but it does make accessibility an integral part of our process. As the tools continue to mature this process will only become more useful and effective. 

 

 

 

 

Categories: Planet Drupal
Categories: Elsewhere

Arthur Foelsche: Accessibility Linting

Thu, 29/10/2015 - 16:00

First, let me say that I am not an expert in web accessibility. Unfortunately I think most people who are web developers aren't. Worse, evaluating development work to understand how people interact with it is not only hard, it is often relegated to a "508 checklist" rather than being a core piece of how website and application development happens. Further, the tools that help evaluate a site for accessibility concerns often only catch the more glaring concerns, still requiring evaluation by people. 

...human inspection is necessary when it comes to semantics, for instance to assess if the page title properly describes the page, if a particular element has either not been marked up at all or with a too generic element, or if elements which belong logically together can be grouped inside a proper element.

The report shows once more that human inspection is crucial to achieve a high degree of web accessibility, and that a dedicated effort must be made to develop a more modern generation of checkers suitable for the latest standards and recommendations, and tailored for the needs of today's testers, developers, and site owners.

-- Efficient Web Accessibility Testing

And that's the reality- people are still a fundamental part of the process. However, the tools that we do have now can provide a helpful first pass in evaluating our work. We have an opportunity to bring some accessibility questions to the fore during the development process.

My interest in linting is exactly this- that it is an easy way for teams integrate accessibility evaluation throughout the entire lifecycle of a project. By making it part of the pull request process these tools- as imperfect as they maybe- can catch some concerns early which can alleviate pressure if significant alterations are needed. Discovering that an ajax widget poses accessibility challenges is much easier to deal with early in the project rather than in a quality assurance sprint at the end. When accessibility problems make code unmergeable then teams can take responsibility for something they may have not realized until very late in the process. Scheduling regular time for assessment by people is of course still needed but the hope is that those reviews will be much more effective since many obvious concerns have already been addressed.


The results of a linting test against google.com. Accessibility concerns crop up everywhere.

So how can it be brought into to a continuous integration workflow? For some first pass testing, I have used access_lint which relies on Google's Accessibility Developer Tools to provide testing on CircleCi. Here's an example project which shows how implement linting as a test. It's basically three lines of code, two of which don't really count. Note that I'm using a specific branch of access_lint which handles the return status from the tests for CircleCi to evaluate. You can see the test result here.

The reality is that it's simple to integrate rudimentary tests for accessibility concerns. It does not absolve a team from doing a full audits but it does make accessibility an integral part of our process. As the tools continue to mature this process will only become more useful and effective. 

 

 

 

 

Categories: Planet Drupal
Categories: Elsewhere

Acquia Developer Center Blog: 3 Secret Features in Drupal 8

Thu, 29/10/2015 - 15:20
Steve Burge

You've undoubtedly heard about some of the major new features in Drupal 8.

You've heard that Views is in core, that there is a new WYSIWYG editor, and that the codebase has been redesigned with Symfony.

At OSTraining we've written posts about many of these headline features, including one we posted here at Acquia called, 10 New Features in Drupal 8 Core.

Tags: acquia drupal planet
Categories: Elsewhere

Drupal Commerce: Commerce 2.x Stories: Currencies

Thu, 29/10/2015 - 15:03

Welcome back. Last week we discussed our efforts around libraries, Composer, dependent modules. This week it’s time to jump into Commerce itself. Let’s start with currencies.

The very first Commerce 2.x story discussed our efforts to replace the hardcoded Commerce 1.x currency list with one generated from an external source. It also discussed our efforts to improve currency formatting. This work resulted in the commerceguys/intl library. It contains a list all currencies in the world, as well as translated currency names and symbols for over 200 languages. This list gets updated and expanded every 6 months (according to the CLDR release schedule).

On the Commerce side, currencies are configuration entities. A price field is provided that stores amounts and their currency codes.
The field widget and formatter are locale aware and use the intl library's NumberFormatter to do the heavy lifting.

Read on for more details...

Categories: Elsewhere

Blair Wadman: An introduction to preventing SQL Injection in Drupal modules

Thu, 29/10/2015 - 13:21

If there is one fear that most developers experience, it is the fear of security vulnerabilities with the code you have written. Bugs are one thing, but security holes that can be used to expose user data or wreck havoc on the database are the cause of many a nightmare. One of the most common forms of attack is SQL Injection. SQL Injection involves injecting malicious commands into a query, usually via some form of user entry.

Fortunately, Drupal provides the tools to protect your website or application against SQL Injection, as long as you follow best practice.

This is best illustrated with an example. This is a simple, harmless query that selects everything from the node table.......

Categories: Elsewhere

Daniel Pocock: reSIProcate 1.10 release

Thu, 29/10/2015 - 13:20

reSIProcate 1.10.0 was released a few weeks ago and after going through the various QA cycles has become available in packages for Debian jessie-backports, EPEL6 and EPEL7 and the latest releases of Fedora and Ubuntu.

Key features of the 1.10.x branch:

A 1.10.1 release was tagged yesterday and is not yet widely available in packages. This release is only significant for people using RADIUS authentication and keen to change from the FreeRADIUS-client library to radcli.

Categories: Elsewhere

Dutch Open Projects: Introducing the Font Awesome SVG module

Thu, 29/10/2015 - 09:12

Icon fonts, what a great idea. Add a single font to your site, and you get a complete set of simple icons for an enormous array of possibilities. A popular example is Font Awesome. Created by Dave Gandy for use with Twitter Bootstrap, it is now deployed on many websites. However, more recently, the merits of icon fonts have become the subject of criticism. This blog post is not about convincing you icon fonts are a bad idea and you absolutely must start using something different. For an introduction on the topic, I will gladly point you to this great post over on CSS Tricks.com. However, if you would like an alternative, there is now the Font Awesome SVG module for Drupal. It is an add-on module to the Icon API module that will render the Font Awesome icon set as inline SVG data. It is mostly still experimental, to be able to gain experience with using inline SVG with a minimal effort.

Categories: Elsewhere

Drupal CMS Guides at Daymuse Studios: 10 Native Applications Every Drupal Web Developer Needs

Wed, 28/10/2015 - 22:56

Your native applications are the bread and butter of your web development tools. Here's our 10 key recommendations every developer needs plus a bonus.

Categories: Elsewhere

Mediacurrent: New eBook: How to Prepare Your Website for Drupal 8

Wed, 28/10/2015 - 20:36

Drupal 8 is here! Is your team ready?

Whether you’re on the brink of an upgrade or still waiting to make the move, now is the time to prepare your website for Drupal 8. To help get you ready, we compiled our advice and knowledge into a new eBook.

Categories: Elsewhere

Chapter Three: Drupal Apple News Module

Wed, 28/10/2015 - 20:04

Chapter Three has developed a powerful, flexible Drupal module to publish Drupal 7 content directly to News, Apple’s all-new app available with iOS 9. The Apple News module is Chapter Three’s most recent contribution to the Drupal community.



Apple News delivers rich and immersive news, magazine, and web content to millions of users on iPhone and iPad. With Apple News Format, publishers can create signature content for News. Content is automatically optimized for both iPhone and iPad and publishers can earn revenue with iAd, Apple’s advertising platform. Senior Chapter Three developers seized the opportunity to build a module for Drupal 7 sites to publish content to News.

Categories: Elsewhere

InternetDevels: Drupal is the best solution for ecommerce websites

Wed, 28/10/2015 - 19:34

Dear readers, once we told you about building social shopping projects with Drupal. 
Now it’s time to discuss Drupal ecommerce benefits. Let the big shopping begin! ;)

Read more
Categories: Elsewhere

Axelerant Blog: 10 Pain Points Fixed With Drupal E-commerce Sites

Wed, 28/10/2015 - 19:00

Evolving technologies and news media trends have kept e-commerce strategists on their toes. They have to do regular brainstorming to keep their e-commerce website on top so that marketing can generate substantial leads, and sales can make quota.

Today even operations and admin departments are asking for an integrated e-commerce system. The bottom line is: demand for robust and highly scalable Drupal e-commerce sites are at an all-time high.

In recent discussions with several e-commerce strategists, we tried to identify today’s top challenges to the industry. E-commerce website decision makers need fool-proof solutions that address common pain points while giving them a leg up on the competition. Here’s the lowdown:

1. Upgrading Legacy Systems

Your admin and support staff have spent a significant amount of time getting their hands on legacy systems. Management relied on the same system for an extended period too. There will always be several roadblocks when upgrading a system like this.

Still, it’s the right time to do it if you’re facing issues like higher operation and maintenance costs, bad user experiences, changing business processes, a lack of integration, and poor mobile accessibility. Legacy systems like this are holding organizations back.

Thanks to evolving new technologies, there are several options available to replace our legacy systems with feature rich and light-weight applications. For e-commerce companies, it’s always recommended that you keep up with legacy systems upgrades.

2. Integration With Enterprise Applications

I keep getting client queries like: “Can your solution easily integrate with SAP? Can my system integrate with Sharepoint? How can I migrate my data from the old database? Can I get my CRM application integrated with an e-commerce system?” and so on.

My answer is always yes—and why not? It’s true, better integrations lead to automated processes, which can seriously increase productivity. You can’t deny the benefits of using effective software solutions with your e-commerce platform.

Recently we integrated Quickbooks with Drupal Commerce for a leading US based e-commerce company. They indicated clearly that managing across two different systems was a major pain. They had tons of manual work to do when it came to managing their finances and syncing with their E-commerce system.

3. Better Payment Solutions

You can’t imagine your clients sending money through checks or demand drafts now. Your consumer is more demanding now; they want lightning fast payment solutions.

Reports reveal that around 90% B2C transactions are completed via payment gateways. E-commerce sites end up losing a significant number of clients if the site doesn’t support modern payment modes and a variety of them (e.g. Credit card, Debit card, NetBanking, Mobile Banking, Paypal, Google Wallet, Mobile Money wallets, etc.)

A technically advanced and secure e-commerce system can be easily integrated with multiple payment solutions for a better user experience. Security is a prime concern when transactions are involved; this can’t be overlooked.

4. Seamless User Experiences Across Multiple Platforms

Taking your e-commerce platform across multiple devices is inevitable now. A large number of audience groups are surfing e-commerce websites from mobile and tablets as well—in fact, most of them are. The trend has been supported by Google’s last algorithm change that has started giving a boost in the ranking of mobile responsive websites.

Responsive Web Design isn’t an option anymore. Responsive web design adapts proportion-based grids, flexible images, and CSS3 media queries, an extension of the `@media` rule in a way so that website is readily available from devices.

5. Integrated Content Management System

Algorithm changes by Google has placed content marketing in the forefront of digital marketing strategies. Integrated CMS helps in controlling Search Engine Optimization (SEO), Conversion Rate Optimization (CRO), and website analytics that reflect the customer’s nurtured journey.

If e-commerce websites don’t have significant product information, reviews and comparisons, and other content on a regular basis, visitors won’t make it to your site.

6. Seamless Integration With Social Media Platforms

According to reports, a large number of users do research on social media before making a purchasing decision. Favored social media companies have started integrating this into their purchase journey.

Facebook and Twitter have already integrated buy buttons, and Instagram has integrated like2buy. These allow customers to make a purchase directly from their social media platforms. All of these support different promotional activities like creating a particular product page and promoting products to large audiences.

These changes have kept social media integrations and campaigns at the forefront of marketing and promotional strategies for e-commerce companies. A good e-commerce system should be equipped with features to integrate with social media sites and promote your e-commerce business extensively over the web.

7. Convenient Site Administration

Managing a large number of products, tracking payments, processing orders and shipping products are always tedious but necessary tasks. This calls for an intuitive and easy to use admin interface to manage this day to day. The site admin should be robust enough to automate the entire process.

Picking an extremely scalable framework and technology can only help in building a highly intuitive, user-friendly, and robust site admin panel.

8. Regular & Cost Effective Maintenance

E-commerce is the new traditional business to be in. You’ve got to optimize and update your website on a regular basis to suit your users. Updating product catalog, pricing, discount structures, creating new category pages, creating new products, creating and updating deal pages—these are a few examples.

A regular and cost effective maintenance system that supports an entire process and highly effective user experience is needed. These activities also help in build up brand value.

9. Personalization

Stellar e-commerce companies look at everything when pursuing higher success rates. Websites are now prompting users to provide extensive demographical data. This helps them keep track of likes, dislikes, and purchase patterns.

Companies are starting to send emails showing data-driven personalized content with this data. Amazon has done this extensively with great success.

Personalization is a core driver across their pages. It all started with “People Who Bought This Also Bought,” and has been followed up by “More Items to Consider, Get Yourself a Little Something, New For You, Inspired By Your Shopping Trends, More Top Picks for You,” and so on.

A suitable technical architecture is a must. This puts demographical information to work with your customer in a unified way as a key to offering a personalized (and persuasive) experience. Technology should bring products and content together strategically (e.g. new arrivals and recommendations).

10. Advanced Security Features

Cyber and Web security is a serious concern of everyone. From Heads of State to CTO’s, there’s a significant emphasis on making laws tough to deal with ever-increasing cyber attacks and breaches.

We’ve witnessed serious data breaches with high profile stores like Staples, Sears, Target, and many more. None of us can afford such cracks in our systems.

Improving controls over the usage of online data and data security to protect your websites from cyber attacks aren’t optional anymore. Thankfully, Drupal e-commerce sites can be secured with secure checkouts and login powered with SSL (Secured Sockets Layer) Protection.

What’s Next?

We’ve got e-commerce website experience. Migrating to Drupal Commerce or building from the ground up isn’t easy to do alone.

We’ll answer your questions. Ask away.

The post 10 Pain Points Fixed With Drupal E-commerce Sites first appeared on Axelerant.

Categories: Elsewhere

Daniel Pocock: Free Real-Time Communications workshop in Manchester, 2 November

Wed, 28/10/2015 - 17:29

Manchester Free Software and MadLab are hosting a workshop on Free and Federated Real-Time Communications with Free Software next Monday night, 2 November from 7pm.

Add this to your calendar (iCalendar link)

Users and developers are invited to come and discover the opportunities for truly free and secure chat, voice and video with WebRTC, mobile VoIP and the free desktop.

This is an interactive workshop with practical, hands-on opportunities to explore this topic, see what works and what doesn't and learn about troubleshooting techniques to help developers like myself improve the software. This is also a great opportunity for any Java developers who would like to get some exposure to the Android platform.

People wishing to fully participate in all the activities are encouraged to bring a laptop with the Wireshark software and Android tools (especially adb, the command line utility) or if you prefer to focus on WebRTC, have the latest version of Firefox and Chrome installed.

If you are keen to run the DruCall module for WebRTC or your own SIP or XMPP server, you can try setting it up as described in the RTC Quick Start Guide and come along to the workshop with any questions you have.

A workshop near you?

Manchester has a history of great technological innovation, including the first stored program computer and it is a real thrill for me to offer this workshop there.

FSFE Manchester ran a workshop evaluating the performance of free software softphones back in 2012.

Over the coming months, I would like to be able to hold further workshops in other locations to get feedback from people who are trying this technology, including the Lumicall app, JSCommunicator and DruCall. If you are interested in helping organize such an event or you have any other feedback about this topic, please come and discuss it on the Free RTC mailing list.

Categories: Elsewhere

Drupal Association News: A Warm Introduction to the Drupal Community

Wed, 28/10/2015 - 17:18

The Drupal Community is an incredibly friendly, welcoming place. For proof, look no further than Sébastien Toullec, a man who came to DrupalCon Barcelona as a true beginner with web technology, and has come away excited and passionate about Drupal.

Sébastien was introduced to the community by his friend, Nicolas Bouteille, who has been working with Drupal since 2010. The two met when Sébastien had fallen on hard times and Nicolas, seeing a kindred spirit in Sébastien, took him under his wing. Nicolas thought Sébastien would feel welcomed and inspired by the Drupal community, and he figured there was no better way to introduce him to Drupal than at DrupalCon!

A few weeks before the convention, Nicolas reached out to the Drupal Association. He shared Sébastien’s story, and asked if we would be willing to provide a ticket for Sébastien to participate in the morning keynotes and to access some of the working areas so that he might work on increasing his Drupal knowledge. We were happy to comply, and received a glowing email from Nicolas and Sébastien after the convention. Here’s what Sébastien had to say:

"Hola Drupalistas!!!!

It's now one month since I was introduced to the Drupal community, and after attending DrupalCon 2015 in Barcelona I want to tell you about my feelings. First, I want to thank Nicolas Boutielle and the Drupal Association for introducing me to such a great community.

Not a long time ago I was homeless, totally lost on the bad habits of the street. Now that I know the community and the power of Drupal, I have a goal in my life. Of course, it's making money... but also, when I become a genius geek (if it ever happens), I look forward to taking part in the Drupal project. The way you are all sharing information and experiences, and the way you help other people makes me think about a family. I feel like I saw a big one in Barcelona!

So, keep on behaving this way. I’d like to send special greetings to Mike Bell (keep on fighting man), and I am excited to see you in Dublin next year, maybe for my first sprint!! Can't wait to be there.

Thanks again from a Drupal beginner.

-Toulix"

"Sébastien really had the experience I was wishing he would have, and I had an awesome week as well,” Nicolas told us by email. “He can now create taxonomies, content types with term reference fields, and views with exposed filters. He really struggled to work this all out, and actually got confused several times before he could get there... but I was so happy to see the light in his eyes the first time he got the term reference field to suggest all his terms at content creation."

Thank you to everyone in the community who helped make Sébastien’s introduction to Drupal so bright. If you want to help Sébastien out by mentoring him on various aspects of Drupal, you can find his drupal.org user page at https://www.drupal.org/u/toulix.

Categories: Elsewhere

Promet Source: Thanks for a great camp, Ohio!

Wed, 28/10/2015 - 16:18
Drupal Talks, Training & Code Sprint in Columbus

 

The community gathered on The Ohio State University campus in Columbus to share ideas about a wide range of topics, including:

- Tips on building sites with Drupal 8

- How to promote the Drupal project

- Business best practices for Drupal shops

The Columbus Drupal community also hosted their first core code sprint.

Categories: Elsewhere

Drupal Watchdog: Back to the Future IV

Wed, 28/10/2015 - 16:09
Feature

In previous episodes, Marty McFly time-traveled to 1955 … Oh wait, that’s the wrong article.

So: In the previous issue of Drupal Watchdog, we introduced the Content Preview System (CPS). With CPS you can preview a site as what it would look like in the future, and allow tracking changes to the site in so-called ‘site versions’. With this powerful concept, it is possible to view a site as it will look after the changes have actually been made. Once all interested parties are satisfied with the outcome, the site version is published and all the changes go “live.”

There are two main advantages to this approach: Being able to publish several things together in context (e.g., articles with supporting sidebar or news content, an article series, a feature gallery, etc.), and being able to tightly control the workflow of content that is shown publicly to your visitors.

While this concept for a single editor is already powerful, it really starts to shine once there is a content team.

And that’s what this article is about: Extending the workflow of CPS to work for teams with different roles, permissions, and responsibilities.

You Will Learn To:
  • Set up CPS Workflow Simple for three different roles;
  • Use CPS reviews to enhance your workflow;
  • Set up an entity-based workflow that is part of the larger workflow;
  • Extend workflows.
A Simple Workflow with CPS

In the following example, it is assumed that the entities you use are revisionable (e.g., use file_entity_revisions, taxonomy_revision, etc. modules) to make full use of CPS. Only revisionable entities will work with the CPS workflow.

To get started, download the CPS, Diff, and Drafty modules and have drush download any other dependencies:

$ drush dl cps drafty diff $ drush -y en cps_workflow_simple cps_node diff

This will download the following modules to your code base: cps, ctools, diff, drafty, entity, entity_status, iib, mailsystem, mimemail, views

After this step you will see a nice “Site version” widget below the admin and shortcuts menus.

Categories: Elsewhere

Mediacurrent: How to Get a Summary of Watchdog (dblog) Messages

Wed, 28/10/2015 - 14:53

While working on a site audit, I wanted to be able to see what errors were currently happening on the site. I checked and they had dblog enabled already with a few days of errors, but going to admin/reports/dblog showed me pages full of the same error. This can happen when there is an error that occurs on a popular page or happens on every page load and it makes the logs difficult to read. In addition to that, the overview page truncates the error message and so you need to click through to the detail page to see the entire thing.

Categories: Elsewhere

LevelTen Interactive: User Moderation Sandbox Project for Drupal - Community Management of New Users to Avoid Spammers and Trolls

Wed, 28/10/2015 - 06:00

In my 'spare time,' I manage and moderate a fairly large community of people who are traveling (by car, truck, motorhome, or motorcycle) North, Central, and South America. Powered by Drupal, of course, the site works as a wiki in addition to having active forums. We strive to make the website as open as possible. Unfortunately, we were having a hard time finding a good balance between protecting the forums, comments, and wiki-type pages from advertisers and related spammers, and locking down the site so user registration took too long....Read more

Categories: Elsewhere

Realityloop: Building an Email Notification System for Drupal (2/2)

Wed, 28/10/2015 - 05:56
28 Oct Jarkko Oksanen

A few weeks ago I went through the different options you can use to create simple notification systems.

This blog post is about creating a simple notification system using the most robust of the solutions Message stack. This blog post will include step by step instructions which you can then continue to built the system that you truly need.

I’ve kept it very simple, and if you have any questions, feel free to ask them in the comments below. And as in all things Drupal, there is a hundred other ways to go about it.

What we will accomplish:
  • Allow users to opt out/in to the notifications
  • Notify user for comments to his/her content

This simple functionality can then be expanded upon with anything you wish.

Example with Message stack for the Article content type

In this example we will have a basic Drupal 7 setup, and the content type we're working with is the basic 'Article' content type.

A message is created when one of the events occurs that we stated before. Then we check the type of the message and compare if the user has allowed notifications for this type of message. And if he has, then we send the message.

I’ve exported the rules and also created a feature (module) that you can use to get the example on your own development. Feel free to use it and contribute more to the GitHub repository.

Step five: Add your own messages to the previous rule

From this point forwards you can start building more and more notifications.
 

  1. Step one: Create a message type and add type field

    Create a message type. To do this navigate to admin/structure/messages and add a message type. I added a message type called message as for this example you need nothing more specific than that.

    In this message type, add a text list field and list all the different notifications you would like. Again for simplicity we’re using a text list field instead of an option that you can modify after. If you use this way, remember to add all your settings before adding any content, as it cannot be changed after.
     

    Also add the following arguments to the message type.
     
     
  2. Step two: Set up fields for the user

    Add a field to the user profile that will have all the options available. In my case I will be adding a field called “Notify me when for” that will be of type list and will contain all of the notifications stated above. This example is simplified, and can be used for simple setups. You can use the same field you created before, just change the widget to checkbox.

    This will list all your notification opt ins
     
  3. Step three: Build the rule that creates the messages

    This rule creates a message each time a comment is created.

    The logic is in the rule:

    1. Create entity, message
    2. Set data, message type
    3. Set data, message title
    4. Set data, message body

    Here is the rule exported:
    1. { "rules_message_comment" : {
    2. "LABEL" : "Message: Comment",
    3. "PLUGIN" : "reaction rule",
    4. "OWNER" : "rules",
    5. "REQUIRES" : [ "rules", "comment" ],
    6. "ON" : { "comment_insert--comment_node_article" : { "bundle" : "comment_node_article" } },
    7. "DO" : [
    8. { "entity_create" : {
    9. "USING" : {
    10. "type" : "message",
    11. "param_type" : "message",
    12. "param_user" : [ "site:current-user" ]
    13. },
    14. "PROVIDE" : { "entity_created" : { "message_created" : "Created message" } }
    15. }
    16. },
    17. { "data_set" : {
    18. "data" : [ "message-created:field-message-type" ],
    19. "value" : { "value" : { "comment" : "comment" } }
    20. }
    21. },
    22. { "data_set" : {
    23. "data" : [ "message-created:arguments:title" ],
    24. "value" : "New comment"
    25. }
    26. },
    27. { "data_set" : {
    28. "data" : [ "message-created:arguments:body" ],
    29. "value" : "Your [comment:node] has a new comment!\r\n\r\nBest regards,\r\nCool notify example"
    30. }
    31. }
    32. ]
    33. }
    34. }

    After this rule is setup, you can see messages forming after comment submission.
     
  4. Step four: Build the notify rule

    What you need to do after this is to create a rule that sends notifications on message creation and checks that the user that it’s being sent to has the message type notifications set up.

    This rule consists of two parts.

    The rule that triggers on creation of a message. It is set to trigger the notify rule set mentioned later.
    1. { "rules_message_notify" : {
    2. "LABEL" : "Message: Notify",
    3. "PLUGIN" : "reaction rule",
    4. "OWNER" : "rules",
    5. "TAGS" : [ "Message" ],
    6. "REQUIRES" : [ "rules", "message" ],
    7. "ON" : { "message_insert" : [] },
    8. "DO" : [
    9. { "component_rules_message_notification" : { "message" : [ "message" ] } }
    10. ]
    11. }
    12. }

    This is the notify set. The logic is the following:

    1. Add variable to not send
    2. Check that user has the correct notification setting in his profile
    3. If yes, send the notification by email
     

    1. { "rules_message_notification" : {
    2. "LABEL" : "Message: Notification",
    3. "PLUGIN" : "rule set",
    4. "OWNER" : "rules",
    5. "TAGS" : [ "Message" ],
    6. "REQUIRES" : [ "rules", "message_notify" ],
    7. "USES VARIABLES" : { "message" : { "label" : "message", "type" : "message" } },
    8. "RULES" : [
    9. { "RULE" : {
    10. "PROVIDE" : { "variable_added" : { "variable_added" : "Added variable" } },
    11. "DO" : [
    12. { "variable_add" : {
    13. "USING" : { "type" : "boolean", "value" : "0" },
    14. "PROVIDE" : { "variable_added" : { "variable_added" : "Added variable" } }
    15. }
    16. }
    17. ],
    18. "LABEL" : "Provide variables"
    19. }
    20. },
    21. { "RULE" : {
    22. "IF" : [
    23. { "entity_is_of_bundle" : {
    24. "entity" : [ "message" ],
    25. "type" : "message",
    26. "bundle" : { "value" : { "message" : "message" } }
    27. }
    28. },
    29. { "data_is" : {
    30. "data" : [ "message:field-message-type" ],
    31. "value" : { "value" : { "comment" : "comment" } }
    32. }
    33. },
    34. { "list_contains" : { "list" : [ "message:user:field-message-type" ], "item" : "comment" } }
    35. ],
    36. "DO" : [ { "data_set" : { "data" : [ "variable-added" ], "value" : "1" } } ],
    37. "LABEL" : "Condition: My article has comments"
    38. }
    39. },
    40. { "RULE" : {
    41. "IF" : [ { "data_is" : { "data" : [ "variable-added" ], "value" : "1" } } ],
    42. "DO" : [
    43. { "message_notify_process" : {
    44. "message" : [ "message" ],
    45. "save_on_fail" : "0",
    46. "save_on_success" : "0",
    47. "mail" : [ "message:user:mail" ]
    48. }
    49. }
    50. ],
    51. "LABEL" : "Send notification"
    52. }
    53. }
    54. ]
    55. }
    56. }

     

A few other tips

This is a simple example of how you can start building your own email notification system. A few pointers to make it even better.

  1. Utilize Message subscribe

    The message stack comes with message subscribe to allow you implement subscription type notifications.
     
  2. Add HTML to your Drupal mails / https://www.drupal.org/project/htmlmail
    By default Drupal’s emails are very plain, and if you want to add some color, this is a good way to do it.

 

drupal planet
Categories: Elsewhere

BlackMesh: Interview with Cathy Theys about attending her first php[world]

Wed, 28/10/2015 - 05:00

The BlackMesh team is excited about php[world] 2015 – the annual conference that brings together developers from across the PHP community! Not only is it thrilling for us to sponsor the event, but our very own Drupal community liaison Cathy Theys (YesCT) will be in Washington, D.C. attending the conference.

Cathy is a Drupal expert, started using Drupal in 2006, and has been involved in and contributing to the Drupal community since 2008. She recently received the (first) annual Aaron Winborn Award recognizing her personal integrity, kindness, and above-and-beyond commitment to the Drupal community.

Though attending Drupal events is nothing new for Cathy, php[world] 2015 should prove to be different. I sat down with Cathy to discuss how it is a unique event, what she expects from the conference, and why she is excited to attend an event that is outside of the Drupal realm.

So Cathy, you’ve been to lots of Drupal events but never attended a php[world]. What sparked your interest in attending this year?

I go to 14+ events each year and in the past they were almost all Drupal. I started with BlackMesh in 2014, and we host many different websites, not just Drupal. Additionally, Drupal 8 has been interacting with many different PHP projects. So, I gave myself a goal to attend at least three non-Drupal events each year. Earlier this year, I presented at Open Source Bridge on Integrating Mentoring into Open Source Communities and participated in the conversations at the Community Leadership Summit. What really sparked my interest in php[world] was one of the Drupal Core commiters, Angie (webchick), live tweeting from last year's conference. Her posts were very intriguing and I put this conference on my "want to see" list.

I feel there are so many PHP projects that people can learn from each other. I’m keen to share what works for Drupal with others, and in turn, learn what is working for other projects.

Having never attended this event, what do you think this event is about?

HA! PHP, with a heavy dose of open source. Guess I’ll find out!

Is there anything particular that you are looking forward to? Session? Speakers?

Oh yes, a few speakers I am looking forward to seeing are Tessa Mero, Lorna Mitchell, and Anthony Ferrara, just to name a few.

A few sessions that sound really interesting are...

Invented Here: Migrating Legacy Data to Drupal 8 by Gregory Wilson

Why We're Bad At Hiring (and how to Fix It) by Kerri Miller

The Art of Programming by Erika Reinaldo

Oh, and of course, Debugging in Drupal 8 by Kalpana Goel

I'm also really looking forward to seeing some of the people I met earlier in the year at Open Source Bridge and Community Leadership Summit, I hope some are gonna be at php[world].

How do you think this event will be different than Drupal events?

I am interested in finding out! I'm expecting people will attend sessions more than at Drupal events. At Drupal events, I usually see a very few sessions, since mostly I like to be involved in the Hallway Track and the Sprint room. Maybe it will be similar though?!

How do you feel about attending a non-Drupal specific event?

I'm super excited! And a bit nervous. It is good to do something as a "newcomer" to remember what it feels like to be the new person. At Drupal events I know … *a lot* of people there. And going to a non-Drupal specific event is a good reminder for me to know how new people feel at Drupal events.

In addition to working on Drupal 8 core, mentoring and speaking at events, I also have a keen interest in general tech event logistics. Which makes sense seeing as I go to a lot! I have a small part in organizing sprints at some Drupal events … and a much bigger part in organizing MidCamp, the Midwest area Drupal camp in Chicago. Last year at MidCamp we did a bunch of things to make the camp more accessible and welcoming to people. I follow a lot of things that conferences like AlterConf do. So, going to a new event is interesting for me, cause I like to keep my eye out for good ideas that might make sense to eventually become common best practices.

With all your experience and contribution from attending Drupal events and sprints, how do you feel you can contribute to this event?

Well, for one, I'm gonna tweet a bunch for sure! :) Follow me at @YesCT.

I'm super looking forward to listening to what other projects are struggling with. I'm sure we share concerns about many things. So, I guess I feel like I can contribute, by listening and really participating. I'm hoping I can add to conversations too (hallway track!)

Why do you think others should attend this event?

For learning, reinforcing relationships, and meeting new people!

Thank you Cathy!

Register today to join Cathy and the rest of the BlackMesh team at php[world] November 16-20. See you there!

Drupalphpevents
Categories: Elsewhere

Pages