Author Topic: Embeded Quote in email with link to quote on line.  (Read 1318 times)

Offline bscunningham

  • Sr. Member
  • ****
  • Posts: 67
  • Get a MAC and stop asking me dumb questions
    • View Profile
    • www.spaclique.com
Embeded Quote in email with link to quote on line.
« on: 12/July/2010, 07:18:56 PM »
First, LOVE the new quote functions! THANK YOU!

When sending quotes via email with the option to attach the quote, the email body starts with:

Quote
Thank you for requesting a quotation. Please find attached our quotation in accordance with your stated requirements. To view this quote online and accept, partially accept, or reject it, please visit: http://www.spaclique.com/index.php?option=com_nbill&action=quotes&task=edit&cid=9592.

This is fine and I have found the language file where this can modified NBILL_EM_NEW_QUOTE_PAR_1_ATTACHED

We have found that our users prefer the quote to be embedded directly into the email. When using the "Embed the document in the message" option, the default configuration for that does not provide a link back to accept the quote.

It seems like I should be able to just copy the language text from NBILL_EM_NEW_QUOTE_PAR_1_ATTACHED to NBILL_EM_EMBEDDED_QUOTE_INTRO and the link back to the quote should be generated.  But it doesn't look like that language parm is being used in the quote email templates.

I suspect something in the quote email template will need to be modified. I've looked at it but the hack needed is not obvious to me. Does there need to be a new email template "quote_email_default_embed.php" ?

Maybe you could point me in the right direction and save me a bunch of time sorting this out.

Thanks Russel.

« Last Edit: 12/July/2010, 07:30:26 PM by bscunningham »
PHP Built on:       Linux server2.spaclique.com 2.6.18-028stab064.4 #1 SMP Fri Jul 24 18:08:47 MSD 2009 x86_64
Database Version:    5.0.81-community
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimite

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,955
    • View Profile
Re: Embeded Quote in email with link to quote on line.
« Reply #1 on: 13/July/2010, 10:36:12 AM »
Thanks for pointing out this oversight. The embedded option does not use a template, which makes it a bit more difficult to hack. I will fix it for the next release (by adding a new constant which includes the link to accept/reject), but if you want to fudge it in the meantime, you would need to hack the /administrator/components/com_nbill/framework/classes/nbill.email.class.php file around line 426 where it says:

$footer .= "<br /><br />" . NBILL_EM_REGARDS . "<br />" . nbf_cms::$interop->site_name;

...replace with:

$url = nbf_cms::$interop->live_site . "/" . nbf_cms::$interop->site_page_prefix . "&action=quotes&task=view&id=" . $document->id;
$footer .= "<br /><br />To view your quote online and accept, partially accept, or reject it, please visit: <a href=\"$url\">$url</a>";
$footer .= "<br /><br />" . NBILL_EM_REGARDS . "<br />" . nbf_cms::$interop->site_name;


This is just a temporary measure (I would not normally recommend hard-coding text like that!) - it is probably safer to hard code the text rather than insert a new constant in the language file yourself because if I need to add any further constants to the language file, you could miss out on them during the upgrade otherwise (as the upgrader may think you already have the latest additions).
« Last Edit: 13/July/2010, 10:49:35 AM by netshine »

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,955
    • View Profile
Re: Embeded Quote in email with link to quote on line.
« Reply #2 on: 13/July/2010, 10:38:52 AM »
Ooops - just noticed, the email class file is ionCube encoded. There is no real need for it to be, so attached is an unencoded copy of the version 2.0.9 file.

[attachment deleted by admin]

Offline bscunningham

  • Sr. Member
  • ****
  • Posts: 67
  • Get a MAC and stop asking me dumb questions
    • View Profile
    • www.spaclique.com
Re: Embeded Quote in email with link to quote on line.
« Reply #3 on: 13/July/2010, 05:29:53 PM »
Thanks that works except how can I get that message to appear above the quote?

Would it be:?


$footer .= "<br /><br />To view your quote online and accept, partially accept, or reject it, please visit: <a href=\"$url\">$url</a>";
$url = nbf_cms::$interop->live_site . "/" . nbf_cms::$interop->site_page_prefix . "&action=quotes&task=view&id=" . $document->id;
$footer .= "<br /><br />" . NBILL_EM_REGARDS . "<br />" . nbf_cms::$interop->site_name;
PHP Built on:       Linux server2.spaclique.com 2.6.18-028stab064.4 #1 SMP Fri Jul 24 18:08:47 MSD 2009 x86_64
Database Version:    5.0.81-community
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimite

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,955
    • View Profile
Re: Embeded Quote in email with link to quote on line.
« Reply #4 on: 14/July/2010, 10:01:37 AM »
No, you would need to modify line 417 where it says:

$embedded_message .= NBILL_EM_EMBEDDED_QUOTE_INTRO;

...and change it to:

$embedded_message .= NBILL_EM_EMBEDDED_QUOTE_INTRO;
$url = nbf_cms::$interop->live_site . "/" . nbf_cms::$interop->site_page_prefix . "&action=quotes&task=view&id=" . $document->id;
$embedded_message .= "<br /><br />To view your quote online and accept, partially accept, or reject it, please visit: <a href=\"$url\">$url</a>";


I will think about whether to introduce a template or some other mechanism for embedded documents to make it more flexible in future.

Offline bscunningham

  • Sr. Member
  • ****
  • Posts: 67
  • Get a MAC and stop asking me dumb questions
    • View Profile
    • www.spaclique.com
Re: Embeded Quote in email with link to quote on line.
« Reply #5 on: 03/December/2010, 02:57:26 PM »
Hey, We are just upgrading to 2.0.9. where /administrator/components/com_nbill/framework/classes/nbill.email.class.php is still encrypted.

Can you tell me if it has been modified since this discussion? In other words is it safe to just upload my 2.0.7 version? Normally we'd just do a kDiff on the two version but since it's encrypted.......  ;)
PHP Built on:       Linux server2.spaclique.com 2.6.18-028stab064.4 #1 SMP Fri Jul 24 18:08:47 MSD 2009 x86_64
Database Version:    5.0.81-community
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimite

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,955
    • View Profile
Re: Embeded Quote in email with link to quote on line.
« Reply #6 on: 03/December/2010, 03:28:49 PM »
The file attached above is the 2.0.9 version, unencrypted.

Offline bscunningham

  • Sr. Member
  • ****
  • Posts: 67
  • Get a MAC and stop asking me dumb questions
    • View Profile
    • www.spaclique.com
Re: Embeded Quote in email with link to quote on line.
« Reply #7 on: 03/December/2010, 05:12:47 PM »
Thanks. It seems they are the same.
PHP Built on:       Linux server2.spaclique.com 2.6.18-028stab064.4 #1 SMP Fri Jul 24 18:08:47 MSD 2009 x86_64
Database Version:    5.0.81-community
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimite

Offline bscunningham

  • Sr. Member
  • ****
  • Posts: 67
  • Get a MAC and stop asking me dumb questions
    • View Profile
    • www.spaclique.com
Re: Embeded Quote in email with link to quote on line.
« Reply #8 on: 03/December/2010, 05:14:46 PM »
Thanks. It seems they are the same.
Thanks for pointing out this oversight. The embedded option does not use a template, which makes it a bit more difficult to hack. I will fix it for the next release (by adding a new constant which includes the link to accept/reject),

Maybe next release?
PHP Built on:       Linux server2.spaclique.com 2.6.18-028stab064.4 #1 SMP Fri Jul 24 18:08:47 MSD 2009 x86_64
Database Version:    5.0.81-community
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimite

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,955
    • View Profile
Re: Embeded Quote in email with link to quote on line.
« Reply #9 on: 04/December/2010, 08:31:02 AM »
It is still the same because it is the version 2.0.9 file, and version 2.0.9 was released before you started this thread - there have been no new stable releases since then. A link to accept/reject has been added in 2.1.0 beta (which is available now), and of course will also be present in 2.1.1 stable (which I am hoping to release this month). Don't just replace the 2.0.9 email class file with the 2.1.0 one though, as that will not work.

Offline bscunningham

  • Sr. Member
  • ****
  • Posts: 67
  • Get a MAC and stop asking me dumb questions
    • View Profile
    • www.spaclique.com
Re: Embeded Quote in email with link to quote on line.
« Reply #10 on: 06/December/2010, 01:37:55 PM »
Quote
It is still the same because it is the version 2.0.9 file, and version 2.0.9
So it is.....

[attachment deleted by admin]
PHP Built on:       Linux server2.spaclique.com 2.6.18-028stab064.4 #1 SMP Fri Jul 24 18:08:47 MSD 2009 x86_64
Database Version:    5.0.81-community
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimite