I can create a category with role selected. But I can't create a category with taxonomy selected. I have created a taxonomy 'Mail Group' and added a field 'Email' to it. Added a term 'Group1' to the taxonomy with an email field. But there is no option to select taxonomies while creating a category.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oadaeh’s picture

Component: Code » Documentation
Category: Bug report » Support request

I've added documentation to the README.txt (in the dev branch) and here on drupal.org to explain how to do this. Please verify you have done all the steps necessary.

Have you added a Taxonomy field referencing the vocabulary you created to your user accounts? That can be done on your site at admin/config/people/accounts/fields.

AswathyAjish’s picture

Thanks for the post.

I have added taxonomy term reference in admin/config/people/accounts/fields and I can select taxonomy groups while adding categories. But when sending the mail by selecting this taxonomy group, an error message appears.
"No users were in the selected category(ies), and therefore, the message was not sent."

Then I edited a user and selected taxonomy group. Again I sent mail. Now its working.

Is there any solution to avoid editing user and selecting taxonomy groups?

AswathyAjish’s picture

Is there any way to create category using content types?

oadaeh’s picture

@aswathym, there is currently no way to create a category using content types. The only ways to create categories are by taxonomy terms and roles.

In using user roles, you can create one or more roles that are specifically for Mass Contact, and in the user list (or a view created for that purpose), filter and select the users to be added to a role and add them all at one time.

Either way you go, you will have to update the relevant user accounts so they are a part of the category selection process.

AswathyAjish’s picture

Thanks for the post.

I got an option to create category using taxonomy with groups which contain users.
1. Created a taxonomy 'Mail Group'.
2. Added a field 'User' with field type 'Entity Reference' and widget 'Checkbox/radio button' in that taxonomy.
3. Installed the modules 'Corresponding Entity References' and 'Hierarchical Select'.
4. In Configuration -> Account Settings -> Manage Fields -> Added a field 'Mail Group' with field type 'Term Reference' and widget 'Hierarchical Select'.
5. In Configuration -> Corresponding References -> Added a preset to relate 'User' field in 'Mail Group' taxonomy and 'Mail Group' field in 'User'. Enable the checkbox 'bi-directional'.
6. Added a term 'Group1' with 1 or 2 users selected to the taxonomy 'Mail Group'.
7. Configuration -> Mass Contact -> Add Category -> Added a category 'Category1' with taxonomy 'Group1' selected.
8. Using Mass Contact, send mail to the category 'Category1'.

gumdal’s picture

Component: Documentation » Code
Category: Support request » Bug report
Priority: Normal » Major
FileSize
27.33 KB
133.86 KB
156.56 KB

I have created taxonomy term for Users as described in the documentation's CONFIGURATION AND SETUP section. This is the field in user:

Taxonomy term in user field

I want to send out mass email to only a particular set of users defined by Taxonomy, please note that I don't want to send the mail by role but only to users who has this taxonomy value assigned:

Selection for mail

I am getting the following error when I send out a mass contact mail to this category:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1: SELECT u.uid FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid WHERE ur.rid IN (); Array ( ) in mass_contact_role_create_recipient_list() (line 42 of /home/****/public_html/sites/all/modules/mass_contact/plugins/mass_contact_role.inc).

I realized that the query is not able to find any users. So, I thought of selecting role along with taxonomy vocabulary assuming that an AND operation is run on role and taxonomy vocabulary. This is the configuration of new category option:

Updated mail selection - role + taxonomy vocabulary

However, this configuration sent out a mail to all approved authenticated users of the website!!! :(

I am updating the same ticket as 'bug' as I understand from earlier posts that this is a feature which is implemented and documented. Raising the priority to bring some attention and also coz this is an item which exists from long time. Kindly let me know if any further information is needed.

oadaeh’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Closed (works as designed)

I realize this is quite old by now and probably no longer relevant, but I believe you missed a step:

3) Navigate to Administration >> Configuration >> System >> Mass Contact (admin/config/system/mass_contact) to add your Mass Contact categories using those terms.

For reference, here are the other steps:

To use taxonomy for categories, follow these steps:
1) Navigate to Administration >> Structure >> Taxonomy (admin/structure/taxonomy) and create one or more vocabularies and terms to be used by Mass Contact.
2) Navigate to Administration >> Configuration >> People >> Account settings (admin/config/people/accounts/fields) to add the vocabulary(ies) as one or more fields to the user account (one field per vocabulary).
...
4) Set the various permissions as desired for both Taxonomy and Mass Contact.
5) Modify the user accounts, as desired, to have the various terms selected.

I'm going to close this, but if it is still an issue, feel free to re-open it.

lomale@bluewin.ch’s picture

Version: 7.x-1.0 » 8.x-1.0-beta2
Status: Closed (works as designed) » Active
FileSize
156.02 KB
125.6 KB
204.57 KB

Sorry if I reopen the following issue

But I am unable to create a category with taxonomy selection. It doesn't even show the taxonomy list. Only roles are showing up.
I tried to follow your instructions.

I created a taxonomy vocabulary

Picture 1 Selection_Trainingparticipants
Term : Selected for Mass Contact

Picture 2 Taxonomy_Selection_in_user
I assigned the user field to user

Then I assigned this term to 3 Users

And tried to add a Mass category

See pictures 3 Add Mass category
no taxonomy is showing

Can you give me a hint and help me with this issue. Thanks.

I use Drupal 8.8.0 and Mass contact v 8.x-1.0 beta2

andy-blum’s picture

Also here long after the initial issue creation date having trouble with taxonomy-driven categories looking for an assist