CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Profiles and email notification in case of new user
Pages: [1]

Author Topic: Profiles and email notification in case of new user  (Read 2784 times)

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Profiles and email notification in case of new user
January 15, 2009, 06:33:01 am
Hello.

I have set one profile to email me when a user updates it. This works correctly.

Is it possible to send email notifications when a new user registers on the site and fills this profile during registration process (even before he/she logged into the site)?

Regards,
Danila


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profiles and email notification in case of new user
January 15, 2009, 03:21:04 pm
Hi Danila - Currently the "Notify on Submit" functionality in Profile settings is ignored when the profile is embedded in User Registration and My Account contexts. Our current thinking is that this inconsistency is not desirable - so I've added an issue to fix this for 2.3

http://issues.civicrm.org/jira/browse/CRM-4000

In the meantime, you could potentially use Drupal's "Triggers" module to configure an email "action" whenever a new user registers (there also are probably other ways to do this via Drupal modules).
Protect your investment in CiviCRM by  becoming a Member!

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Profiles and email notification in case of new user
March 21, 2009, 07:39:19 pm
Thank you, Dave.

I created an action which sends an email to admin. This email contains link to a view, sorted by registration date, so the admin can easily find who had just arrived.

Regards,
Danila

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profiles and email notification in case of new user
March 21, 2009, 08:20:17 pm
This sounds cool - what do you mean by "created an action" - is this a module using a hook? a Drupal action? Would be great if you could describe what it does and how to set it up in more detail (and share code - if any). You could add a page to the wiki here:

http://wiki.civicrm.org/confluence/display/CRMDOC/Drupal+Integration+Modules
Protect your investment in CiviCRM by  becoming a Member!

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Profiles and email notification in case of new user
March 21, 2009, 08:45:41 pm
Hello.

It's a simple view, which even does not use any CiviCRM data, for list of users in Drupal, ordered by date:

Code: [Select]
$view = new view;
$view->name = 'registered_today';
$view->description = 'List of users registered on specific date';
$view->tag = 'users';
$view->view_php = '';
$view->base_table = 'users';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'created' => array(
    'label' => 'Registered',
    'date_format' => 'custom',
    'custom_date_format' => 'Y M d',
    'exclude' => 0,
    'id' => 'created',
    'table' => 'users',
    'field' => 'created',
    'relationship' => 'none',
  ),
  'name' => array(
    'label' => 'Name',
    'link_to_user' => 1,
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
  ),
  'mail' => array(
    'label' => 'E-mail',
    'link_to_user' => '0',
    'exclude' => 0,
    'id' => 'mail',
    'table' => 'users',
    'field' => 'mail',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'DESC',
    'granularity' => 'day',
    'id' => 'created',
    'table' => 'users',
    'field' => 'created',
    'relationship' => 'none',
  ),
));
$handler->override_option('title', 'List of registered users by date');
$handler->override_option('items_per_page', 20);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'created' => 'created',
    'name' => 'name',
    'edit_node' => 'edit_node',
    'mail' => 'mail',
  ),
  'info' => array(
    'created' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'name' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'edit_node' => array(
      'separator' => '',
    ),
    'mail' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'registered_by_date');
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));


And the I hardcoded link to this view into a body of email message, which is sent by Drupal core Triggers module on "Trigger: After a user account has been created".

Do you think this is worth putting to wiki?

Regards,
Danila

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profiles and email notification in case of new user
March 23, 2009, 12:04:53 pm
Hi Danila - I suspect others would find this useful. Since it's a Views-specific "how-to", I'd make it a child page of the Views page. Then we might have folks add other views "how-to's" there going forward.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Profiles and email notification in case of new user

This forum was archived on 2017-11-26.