Sending reports with e-mail - alternative option

Questions related to nuBuilder Forte Reports and the Report Builder.

Re: Sending reports with e-mail - alternative option

Postby nc07 » Thu Aug 01, 2019 7:37 am

Janusz wrote:Yeah :-)
it's working
thanks a lot Kev1n


Hi Januz,

Would you assist me with sending email from the database probably with a demo video. I am trying to follow this post to set up but unsuccessful.

Appreciate your time and assistance.

nc07
nc07
 
Posts: 21
Joined: Tue Jun 04, 2019 11:35 am

Re: Sending reports with e-mail - alternative option

Postby Janusz » Fri Aug 02, 2019 12:53 am

Hi,
Please find enclosed video with example how to set-up an email on completelly new nuBuilder instalation.
https://drive.google.com/file/d/1SaZFi- ... sp=sharing

basic steps:
1. Configure mail service in nuBuilder
as in video just use you mail data

2. Create procedure to send e-mail

Code: my_mail
Description: Mail
Run: Hidden

PHP (in the box):
Code: Select all
$to='jr_test@wp.pl';
$body=
'Hi,
This is email from nuBuilder.

Regards
Janusz';
$subj='Test #1';
$att='';
//$filesource = './upload-target/logo.png';
//$filename = 'logo.png';
//$att=array($filename => $filesource);
nuSendEmail( $to, '', '', $body, $subj, $att, false);

3. Create button:

Label: Send Mail
ID: FF_but_mymail
onclick: nuRunPHPHidden('my_mail');

AND that's all.
If you press the button - then the mail will be sent to the given address
(in this case to jr_test@wp.pl)

If you want to send attachement - in the next step - unmark the lines in the php procedure and place the file in the folder.

Janusz
Janusz
 
Posts: 220
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Sending reports with e-mail - alternative option

Postby nc07 » Mon Aug 19, 2019 12:48 pm

Thanks, Janusz for your time and help.

I managed to set up the email function and all works well. The email attachments also worked fine when the file is placed in the folder.

A bit more to the attachment, how can I output a report to PDF and same is sent through email without manually saving it in the folder on the server. As per your assistance earlier, my pdf outputs with few fields data that it is not saving automatically to the server. Any suggestions on how this can be done.
nc07
 
Posts: 21
Joined: Tue Jun 04, 2019 11:35 am

Re: Sending reports with e-mail - alternative option

Postby Janusz » Mon Aug 19, 2019 3:08 pm

Hi,
Normally you can apply the idea from the following post:
viewtopic.php?f=21&t=9905#p19177
modifed nurunpdf.php
......
$PDF->Output('nureport.pdf', 'I');
// 2 lines belowe were added
$PDF->Output('/var/www/html/TestDB/uploads/nureport.pdf', 'F');
$y = shell_exec('send_pdf.sh');
// end
nuRemoveFiles();
.........

and replace the $y = shell_exec('send_pdf.sh'); with nuSendEmail(.....)
Janusz
 
Posts: 220
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Sending reports with e-mail - alternative option

Postby nc07 » Tue Aug 20, 2019 11:29 am

Thank you, Janusz,

Your assistance and time are much appreciated.

After a few errors, I managed to get it working, thanks once again.

Regards
nc07
nc07
 
Posts: 21
Joined: Tue Jun 04, 2019 11:35 am

Re: Sending reports with e-mail - alternative option

Postby nc07 » Tue Aug 20, 2019 1:45 pm

Hi,

Is there any way to reduce the size of the PDF file as at the moment it outputs to about 1.78 MB which is not really that huge but just wondering if it is possible which might reduce the upload time.

regards
nc07
nc07
 
Posts: 21
Joined: Tue Jun 04, 2019 11:35 am

Re: Sending reports with e-mail - alternative option

Postby Janusz » Tue Aug 20, 2019 10:13 pm

Hi,
You can exclude fonts attachement to the generated pdf file.

in the nurunpdf.php at line c.a. 33

comment as following:
Code: Select all
//for($i = 0 ; $i < count($fl) ; $i++){
//      $fnt                                    = $fl[$i][0];
//      $PDF->AddFont($fnt, '', '', true);
//}

this should reduce the size from about 1.8M to few KB
Janusz
 
Posts: 220
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Sending reports with e-mail - alternative option

Postby nc07 » Thu Aug 22, 2019 10:48 am

Janusz wrote:Hi,
You can exclude fonts attachement to the generated pdf file.

in the nurunpdf.php at line c.a. 33

comment as following:
Code: Select all
//for($i = 0 ; $i < count($fl) ; $i++){
//      $fnt                                    = $fl[$i][0];
//      $PDF->AddFont($fnt, '', '', true);
//}

this should reduce the size from about 1.8M to few KB

Thanks Janusz,

This has really helped reduce the file size to 30kb which had decrease the upload time.

Really appreciated.

best regards,
nc07
nc07
 
Posts: 21
Joined: Tue Jun 04, 2019 11:35 am

Previous

Return to Reports