email all records?

prophoto

Active Member
I have a number of different lists in different websites (CCB as one example) where users have signed up for events. One of the fields in the list contains their email. Is there any way I can create a button or link to email all of those people? A simple mailto:abc@defg.com;xyz@abcd.com would work fine. Obviously it would need to grab all of the emails from all records in the list. Thoughts?
 
this isn't working...

Code:
$emails = array_column($this->_row->data(), 'ccb_pilot___email');

or

Code:
$emails =array_column($this->_row->data, 'ccb_pilot___email');
 
If you want to mail ALL rows, as discussed in Skype, unless you take all filtering off of the list display, then only the paginated / filtered rows will be available in the template. And if you are going to do that (remove all pagination and filtering and show all rows in the list) then you might as well then use the list email plugin.

If you don't want to do that, then the best approach would be to load all the rows data yourself, by hand ...

Code:
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('email')->from('yourtable');
$myDb->setQuery($myQuery);
$emails = $myDb->loadColumn();

... should give you all the emails in an array you can then do whatever you need with.

But I still think the easiest way is just to copy your list, and set up the copy to remove all pagination, filtering, etc, only show the email element in the list (and whatever else you absolutely need to see) to reduce rendering load, and set up the list email plugin on it.

-- hugh
 
Thanks Hugh. I will test this and get back to you.

I can definitely use the email plug-in as an administrator but is there any way a non-administrator can use the cron?
 
Will this method be filtered by any rules set in filter drop downs? Unfortunately this client is challenged and needs it to be super easy. Ideally it would follow the list filtering in the frontend.
 
Will this method be filtered by any rules set in filter drop downs? Unfortunately this client is challenged and needs it to be super easy. Ideally it would follow the list filtering in the frontend.


Yes. The list plugin, like any other list plugin, operates on any specifically selected rows, or, if you use the "all" checkbox, then all visible rows.

So I would suggest a non-paginated copy of the list, with whatever filters you want, with the list plugin. I'm sure even the most "challenged" client can be trained to select the top checkbox and press a button.

-- hugh
 
I guess the method we talked about when using $row in default.php template file won't work? There are about 20 different combinations of data throughout 4 lists which is why I would prefer to use the premade list filters.
 
I'm still struggling to understand why you can't just use the list email plugin. That's what it's for. You've indicated that the maximum number of rows you'd be mailing to is under a 100, which is perfectly do-able as a single page display, i.e. you can just turn pagination off, and use the list email plugin to just send to all displayed rows, as controlled by the element filters.

-- hugh
 
Yes. The list plugin, like any other list plugin, operates on any specifically selected rows, or, if you use the "all" checkbox, then all visible rows.
-- hugh
OK I think I have this finally figured out. Please confirm.

Goal: send the same email to the email addresses contained in the list's row data to selected records shown on the page. Be able to choose a few if necessary or only one.

1.JPG2.JPG3.JPG
 
Yes, that looks right.

If you don't want to have the "To" element selection be in the popup when you send, you can pre-define it by using an element placeholder in the "Email to" field, and select "Defined in email to" in "Get email address from".

The list email plugin is highly configurable, but this can lead to confusion on the best way to set it up!

-- hugh
 
Yes, that looks right.

If you don't want to have the "To" element selection be in the popup when you send, you can pre-define it by using an element placeholder in the "Email to" field, and select "Defined in email to" in "Get email address from".

-- hugh

This was the missing piece to the puzzle! Can you update the tooltip to include that info?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top