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 Drupal Modules (Moderator: Donald Lobo) »
  • How to filter list of mailings by mailing group? [SOLVED]
Pages: [1]

Author Topic: How to filter list of mailings by mailing group? [SOLVED]  (Read 856 times)

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
How to filter list of mailings by mailing group? [SOLVED]
July 07, 2012, 09:59:06 am
Is it possible to filter a View of Mailings by the mailing group the mail was sent to? I have CiviCRM integration working but can't find a field for Mailing Group.
 
« Last Edit: July 07, 2012, 06:46:26 pm by davyivins »
There are times I love technology...and then there are times I *love* technology :-)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to filter list of mailings by mailing group?
July 07, 2012, 03:39:51 pm

not part of the views integration code right now, but might not be too hard to do so.

The mail part of the code is here:

drupal/modules/views/components/civicrm.mail.inc

would be great if you can investigate and help add the include / exclude groups and mailing columns.

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Re: How to filter list of mailings by mailing group?
July 07, 2012, 05:49:44 pm
Hi Lobo - I can't find the file you referred to - is this the one?  drupal/modules/views/civicrm.views.inc

Sadly the more I looked at the code the more I remembered that I have absolutely no coding experience :-)
That said I'll have a wild / blind stab at it and see if I get lucky.

But if there's anyone else out there who actually knows what they're doing and has some time on their hands (I know I know..) I'd real appreciate the help.
   
There are times I love technology...and then there are times I *love* technology :-)

davyivins

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 2
    • PURCO SA
  • CiviCRM version: 4.5
  • CMS version: Drupal 6.33
  • MySQL version: 5.5.34
  • PHP version: 5.4.33
Re: How to filter list of mailings by mailing group?
July 07, 2012, 06:45:43 pm
I did it !!

Added the following in the mailing section of drupal/modules/views/civicrm.views.inc  (I added it after line 4679)

Code: [Select]


  //Mailing GROUP table
  $data['civicrm_mailing_group']['table']['group'] = ts('CiviCRM Mailing Group');

  $data['civicrm_mailing_group']['table']['join'] = array(
    // link to civicrm_mailing
    'civicrm_mailing' => array(
      'left_field' => 'id',
      'field' => 'mailing_id',
    ),
  );

  // What group did the mailing go to
  $data['civicrm_mailing_group']['entity_id'] = array(
    'title' => t('Mailing Group'),
    'help' => t('What mailing group was the mailing sent to'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_string',
      'allow empty' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );

There are times I love technology...and then there are times I *love* technology :-)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • How to filter list of mailings by mailing group? [SOLVED]

This forum was archived on 2017-11-26.