Press the button and send the csv

idrive72

Member
Hello, in the meantime I would like to thank all the developers of this fantastic software, you saved my life! ;-)

I have a question to ask you; I have created a list with about 50 items and I can export the CSV file without problems. But I would need to be able to press a button, extract the CSV and send it by email to an address that never changes. It's possible to do it? Could you give me some advice?

Thanks everyone and good evening.
 
You realy need to send by mail entire cvs file?

If not you can use Email/SMS list plugin

Thanks for the reply and for the plugin recommendation. Yes, I need to send the entire csv as an attachment. I tried the plugin, it looks very interesting but I didn't understand how to send the csv as an attachment, I can only send the content of the csv in the body of the message.
 
Thanks for the advice. I took a look at the link and it looks very interesting, I'll have to study it better, I'm not very experienced. My aim is to send a single line of the csv as an attachment. Let me explain: the list in question contains the data of companies that use the service I am building. Each row corresponds to a different company and contains a lot of data. I have to send an email with the csv attached, relating to a single company, to be sent to a remote server which will then have to process the data for printing and other services.
 
Usually a CSV export contains the data of all (or some filtered) records of the list.

But if I get you correctly
  • you need a CSV file attachment containing only one single data row (resp. 2 rows, the 1st one containing the column names + one row with the data)
  • but all emails are going to the same email address?
This is not a out-of-the-box Fabrik function.
But with a post-processing script mentioned in the link you can e.g. read the"big" CSV file created by Fabrik's CSV export, loop over the lines, re-create a one (or 2) line new CSV file, do the mailing (there's a Joomla and a Fabrik sendMail function).

Or use the php list plugin to fetch your data, create the CSV files and do the mailing.

In both cases you'll need a good part of PHP knowledge.
 
Usually a CSV export contains the data of all (or some filtered) records of the list.

But if I get you correctly
  • you need a CSV file attachment containing only one single data row (resp. 2 rows, the 1st one containing the column names + one row with the data)
  • but all emails are going to the same email address?
This is not a out-of-the-box Fabrik function.
But with a post-processing script mentioned in the link you can e.g. read the"big" CSV file created by Fabrik's CSV export, loop over the lines, re-create a one (or 2) line new CSV file, do the mailing (there's a Joomla and a Fabrik sendMail function).

Or use the php list plugin to fetch your data, create the CSV files and do the mailing.

In both cases you'll need a good part of PHP knowledge.
Yes, the csv must have two rows, one with the names of the columns and the other with the data.
I have read the documentation for the link you recommended and am trying to figure out how to do it. Also, maybe, I found a solution at this link. What do you think about it?
I was thinking of using the plugin and customizing the php template. I need to figure out how to intercept the csv file to attach it.
 
There are Joomla and Fabrik mail helpers, e.g.
Joomla
https://docs.joomla.org/Sending_email_from_extensions
Fabrik (little documented, does some additioal tests, then calling Joomla's mailer)
/**
* Function to send an email
*
* @param string $from From email address
* @param string $fromName From name
y * @param mixed $recipient Recipient email address(es)
* @param string $subject email subject
* @param string $body Message body
* @param boolean $mode false = plain text, true = HTML
* @param mixed $cc CC email address(es)
* @param mixed $bcc BCC email address(es)
* @param mixed $attachment Attachment file name(s)
* @param mixed $replyTo Reply to email address(es)
* @param mixed $replyToName Reply to name(s)
* @param array $headers Optional custom headers, assoc array keyed by header name
*
* @return boolean True on success
*
* @since 11.1
*/
public static function sendMail($from, $fromName, $recipient, $subject, $body, $mode = false,
$cc = null, $bcc = null, $attachment = null, $replyTo = null, $replyToName = null, $headers = array())
{...}
You can call it with something like this
$mail_result = FabrikWorker::sendMail($MailFrom ,$FromName, $MailTo, $subject, $message, true,null, $webmasterMail, $attachments);
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top