Author Topic: editing invoice_email_default.php  (Read 822 times)

Offline oO SKIPPY Oo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
editing invoice_email_default.php
« on: 17/September/2011, 01:33:39 PM »
hi - i wanted to change the signoff on the above template from my site name to just my name - however when i remove the line of code that should display the sites name it doesnt make a difference to the email content.

I have generating the email manually by click on the envelope icon in the invoices screen.

Hope you can help me.

Cheers

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,953
    • View Profile
Re: editing invoice_email_default.php
« Reply #1 on: 17/September/2011, 02:42:38 PM »
If you are sending the invoice as an attachment to the e-mail (either HTML or PDF), you need to modify the invoice_email_default_attach.php template.

Offline oO SKIPPY Oo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: editing invoice_email_default.php
« Reply #2 on: 31/July/2012, 01:40:30 PM »
sorry its been a while to reply - i completely forgot that i posted this question.  I'm actually trying to edit the embedded emails.

cheers

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,953
    • View Profile
Re: editing invoice_email_default.php
« Reply #3 on: 31/July/2012, 01:50:04 PM »
The embedded invoice option is not template-driven. To modify the content, you need to amend the language file (see http://www.nbill.co.uk/help/index.php?page=change-text-of-emails.html)

Offline oO SKIPPY Oo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: editing invoice_email_default.php
« Reply #4 on: 16/August/2012, 10:35:43 AM »
is there any way to change the signoff on the email? currently its signing off with my website title but i would like it to sign off with my name.

cheers

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,953
    • View Profile
Re: editing invoice_email_default.php
« Reply #5 on: 16/August/2012, 11:38:34 AM »
To achieve that you would either need to hack the core code (line 408 of the file /administrator/components/com_nbill/framework/classes/nbill.email.class.php), or use the email_pre_send event to programmatically replace the signature in the body text before the email is sent.

Offline oO SKIPPY Oo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: editing invoice_email_default.php
« Reply #6 on: 31/August/2012, 01:58:53 AM »
thanks for that - can you provide more info on the second option?  is there anything in the help files to say how this email_pre_send is used?

cheers

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,953
    • View Profile
Re: editing invoice_email_default.php
« Reply #7 on: 31/August/2012, 08:24:47 AM »
Event folders are explained here: http://www.nbill.co.uk/help/index.php?page=events.html

To use them does require basic PHP programming skills. The parameters passed in to the event contain the message title, body, recipient, etc. and if you want to change any of them, you would need to use PHP string manipulation functions (such as str_replace).

Offline oO SKIPPY Oo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: editing invoice_email_default.php
« Reply #8 on: 04/September/2012, 08:33:33 AM »
are there any examples of scripts i could take a look at ? i dont know php all that well but can find my way around if i have an example.

cheers

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,953
    • View Profile
Re: editing invoice_email_default.php
« Reply #9 on: 04/September/2012, 01:46:30 PM »
In its simplest form, you could do something like this:

$params['body'] = str_replace("text to replace", "replace with this", $params['body']);

...but if you need to replace the text conditionally it becomes more complicated and goes beyond the scope of support.

Offline oO SKIPPY Oo

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: editing invoice_email_default.php
« Reply #10 on: 06/September/2012, 07:43:26 AM »
thanks - this should get me started :)