Topic: body of an email from reports

Hi,

I have been working some on emailing reports, started with quotations and now on to invoices.

The main body of the email seems to be coded in the file reporting/includes/pdf_report.inc using the variable $msg.

I sure would like to be able to write the body of the email using some variable that is in my custom reports in company directory (rep111 for quotations or rep107 for invoices).  That way pdf_report.inc will in general stay the same thru the Mercurial updates but if it is edited heavily to get the body of the email set for all the different report, it becomes a real pain to have to follow. 

Two other files in sort of the same situation are doctext.inc and header2.inc (seems these two files get suggested to be edited often in the forum).  They are often edited just to get a bit of different text in some document.  It would be nice it the text stuff was in the company file and the good hard code to make it run was in the doctext.inc and header2.inc.

I don't know if I am missing something in the reports that will do the msg or the task may be very hard to code.  But the section of this forum is Wish List and I am wishing.

Thanks Joe, Janusz and apmuthu  you have all been a great help to me

ed10

Re: body of an email from reports

FA uses hooks. The devs can incorporated one for such email message parameter tweaks, CAPTCHA auth addons, etc., in the base code of FA.

Re: body of an email from reports

I guess solution to this problem should  be user defined mail templates for various transactions. But yes, this need some work to be done in the code, and would need databse changes, so cannot be done in 2.3.x
Janusz

Re: body of an email from reports

Janusz:

Do you think this is worth your effort?

ed10

Re: body of an email from reports

Yes, I would like to find time to fix this. Email content hardcoded in repo class is definitely design issue, or rather long lasting stopgap smile.

Janusz

Re: body of an email from reports

Janusz:

That is great, thanks.

What I did in the mean time was put this in pdf_report.inc:
    switch ($this->formData['doctype'])
   {
        case ST_SALESQUOTE:
                $msg = _("Attached you will find ") . " " . $subject ."\n\n";
                $msg .="Please contact us with any questions or when you are ready to place this order." . "\n\n";
                $msg .="Thank you for the opportunity to offer this quote to you and we look forward to working with you." . "\n\n";
                $msg .= _("Sincerely,") . "\n\n";

            break;
...


ed10

Re: body of an email from reports

Sure, this is right workaround until this is properly implemented in application repo.
Janusz