103 Posts
Osep45
7 years ago
2
Topic

Hi,

With the email Field,how  to send a mail to the member of the same group as the connected user ?

Thanks in advance,

Osep45

---

Bonjour,

Est-il possible d'envoyer un mail à tous les membres de mon groupe, lors de la création d'un article ?

Comment configurer le champ email, les valeurs dynamiques de champs... etc ?

Merci d'avance,

Osep45

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
0
Level 1

There is no built-in function for this, you would need to use beforeStore code field to first get all groups form user, then all users belonging to each group and their emails and at the end concatenate this values into string and fill some field with this value. They you could use this field in email as To(fields)

103 Posts
Osep45
7 years ago
0
Level 1

I have created a textarea field and filled it dynamicly by a « sql query » : it works.

Here is my query (all my targeted groups are childs of the usergroup id 100. That's why I have add this condition in my query)

SELECT `#__users`.`email`
FROM `#__users`
INNER JOIN `#__user_usergroup_map` ON `#__user_usergroup_map`.`user_id` = `#__users`.`id`
INNER JOIN `#__usergroups` ON `#__user_usergroup_map`.`group_id` = `#__usergroups`.`id`
WHERE `#__usergroups`.`parent_id`='100'

Get a VIP membership