Showing posts with label trigger. Show all posts
Showing posts with label trigger. Show all posts

Monday, June 30, 2014

Open a menu link in new window

In Drupal clicking on the menu links will open in the same window. if we want to open the menu links in new window or new tabs, use 'hook_menu_link_alter',

eg:
  1. function mymodule_menu_link_alter(&$item) {
  2.     if ($item['link_path'] == 'node/10') {
  3.       $item['options']['attributes']['target'] = '_blank';
  4.     }
  5. }

Monday, April 7, 2014

Send a notification mail to custom mail id on user registration

When a user registered a notification mail sent to that users mail id when it is set to admin approval is required. If you want to send a notification mail to the admin mail or a custom mail do the following,


Go to /admin/config/system/actions. In the section "Create an advanced action" choose "send an email" and click on "create". It takes you to a page where you need to enter a recipients email address (Enter the Admin email or your custom email address here), subject and Message, then click save.


Now go to /admin/structure/trigger/user (if you not enabled Trigger module please enable it). In the Section "Trigger: After creating a new user account" Choose "Send e-mail" in the select box. Click Assign.