Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending Idea and Comment Notifications #20

Open
mrentropy opened this issue Oct 10, 2014 · 1 comment
Open

Sending Idea and Comment Notifications #20

mrentropy opened this issue Oct 10, 2014 · 1 comment

Comments

@mrentropy
Copy link

Hi Todor,

I was just wondering: is there any way, when integrating with another program such as Kuena, to leverage sending emails not just just admins but interested forum contirbutors when an idea is commented on?

Thanks a lot,
Carl

@mrentropy
Copy link
Author

Hi Todor,

I thought I'd mention my temporary fix to try out this behavior in case it's useful, or in case you want to caution me against it (I'm relatively new to PHP). I slightly altered the userideasadminmail.php to have your $recipient variable use an array of users instead.

// Get a db connection.
$db = JFactory::getDbo();

// Create a new query object.
$query = $db->getQuery(true);

// Select all records from the user profile table
$query = "SELECT email FROM #__users";
$db->setQuery($query);

// Load the results as a list of stdClass objects
$objectArray = $db->loadObjectList();

// Iterate through the array of objects, and add to a new array
$myRecipientArray=array();
foreach($objectArray as $obj){
array_push($myRecipientArray,$obj->email);
}
$recipientMail = $myRecipientArray;

Thanks again for creating the component. I'm finding it very useful.

Best regards,
Carl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant