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 CiviMail (Moderator: Piotr Szotkowski) »
  • Automatically add email recipients based on relationship
Pages: [1]

Author Topic: Automatically add email recipients based on relationship  (Read 483 times)

kung

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 5
  • CMS version: Drupal 6 or 7
  • MySQL version: 5
  • PHP version: 5
Automatically add email recipients based on relationship
June 24, 2012, 02:54:01 pm
I'm looking for insight on the best way to automatically add email recipients based on a relationship.

Here's the use case: I have an Organization contact type called "Account."  I have an Individual type called "Account Contact."  They have a contact-is / contact-for relationship, and they also have the same legal_identifier field in civicrm_contact.

When a user sends an email to an account, I want to automatically add the account's account contacts as recipients (or, better, give the user a checkbox on the form to include them).  How to do that?
Should I have modeled my contact types differently? Or, if not, I'm thinking the best way to build it is to use a form_alter hook. 
Any other, better ideas?
Thanks!

jimurl

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 0
  • CiviCRM version: 3.4.6
  • CMS version: drupal 6.22
  • MySQL version: 5+
  • PHP version: 5+
Re: Automatically add email recipients based on relationship
June 27, 2012, 09:18:21 am
Hi kung,

A little more info: what do you mean by-
"When a user sends an email to an account,  ..."

What kind of user (an administrator? or an end user who might be sending an email to another end user/contact?), and using what method to send an email (CiviMail bulk mailing? or using the "Send Email" action from the actions menu? ) Or do you mean WHENEVER an email is sent using any method?

kung

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 5
  • CMS version: Drupal 6 or 7
  • MySQL version: 5
  • PHP version: 5
Re: Automatically add email recipients based on relationship
August 03, 2012, 11:31:04 am
Hi. Sorry for not replying sooner.  An administrator would be doing the mailing.  The method will be Actions / Send Email: In this case the admin will enter the Account name or choose Accounts from search results, and somehow the system will find out the Account Contacts for that account (via the relationship) and add them to the recipient list.
Any suggestions you might have would be most welcome.
Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Automatically add email recipients based on relationship

This forum was archived on 2017-11-26.